Using the code that you posted, if I click on any Form, even if its on the
taskbar, it brings all three to the front. Unless, of course, one of the sub
Forms has been explicitly minimized and then this sub Forms will not be
displayed. What is the exact scenario that you would like to see and in what
way is this not working for you?
--
Tim Wilson
.Net Compact Framework MVP
Thomas Fisher said:
How are your Forms layed out?
There is the 'main' form and two 'sub' forms.
This code is in the 'main' form:
CN = New frmConsole(Me)
CN.Show()
CN.Width = Me.Width
CN.Location = New System.Drawing.Point(Me.Left, Me.Top + Me.Height)
CN.Height = 180
RM = New frmRemote(Me)
RM.Show()
RM.Location = New System.Drawing.Point(Me.Left + Me.Width, Me.Top)
'Setup Ownership
Me.AddOwnedForm(CN)
Me.AddOwnedForm(RM)
Thanks for the help with this...
- Tom
"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
How are your Forms layed out? In other words, do you have a main Form that
displays 3 sub Forms - is that the layout? In addition, can you post the
code that you're using with an indication as to where the code is being
called from?
--
Tim Wilson
.Net Compact Framework MVP
"Thomas Fisher" <thesequoyan [[[at]]] hotmail> wrote in message
Thanks!
This method seems to work well with one of the 'sub' forms but the
clicking
on the other doesn't cause the others to appear on top. Any idea why that
might be? (I've triple checked to confirm that the code is the same for
each).
- T
"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
If you set the "Owner" property of the Forms then the associated Forms
will
be brought to the front when one is selected. So let's say that
Form1
is
the
main form and Form2 and Form3 are displayed by Form1, then by setting
the
"Owner" property of the Form2 and Form3 instance, from within the scope
of
Form1 (this), you have associated the instances of Form2 and Form3 with
Form1. So when Form1 is shown, Form2 and Form3 will be shown.
Form2 form2Instance = new Form2();
form2Instance.Owner = this;
form2Instance.Show();
Form3 form3Instance = new Form3();
form3Instance.Owner = this;
form3Instance.Show();
--
Tim Wilson
.Net Compact Framework MVP
"Thomas Fisher" <thesequoyan [[[at]]] hotmail> wrote in message
Hi All,
This should be pretty easy, and I'm sure there's a simple way to do
it,
but
it's eluding me.
The application has three windows open at all times. Needed
functionality:
a
click on any of the three windows should bring the other two to the
front
as
well so that they would all be above any other program windows.
I've been messing with BringToFront and the Activated event but
everything
I
do seems to lead into infinite loops.
Hopefully one of you knows the 'right' way to handle this common
problem.
Thanks for any help!
- Tom