Newbie Form question ?

  • Thread starter Thread starter Stan Sainte-Rose
  • Start date Start date
S

Stan Sainte-Rose

Hi,
Another question about Winforms.
I have a main winform where I display my main menu.
This form is opened using the Maximized Windowstate.
When I call an option, I display a new form using the CenterScreen
StartPosition and I set Show in taskbar as false
But sometimes, I lost the new form focus and I have to use Alt Tab to find
it.
What I have to do for displaying the new form into the Main form ?

Stan
 
yes but that doesent get around the problem he is talking about. If
something gets clicked outside the application he is in, his form still
loses focus right ?

OHM#
Hi Stan,

Will this do it for you?

form2.TopLevel = True

Cor

Regards - OHM# (e-mail address removed)
 
Hi OHM,

Are you sure

I find this terrible behaviour, did you try this.
\\\
Private Sub Form2_VisibleChanged(ByVal sender As _
Object, ByVal e As System.EventArgs) Handles MyBase.VisibleChanged
Me.TopMost = True
End Sub
Private Sub Form2_SizeChanged(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.SizeChanged
Me.WindowState = FormWindowState.Normal
End Sub
///
Although I think that is not what Newbie did ask

Cor
 
Hi Cor,
"I'm not sure what you mean by terrible behaviour, do you mean
me? or do you mean the software? If you meant me, I'm not sure what I've
done ?

In anycase, I did try me.topmost=true. This is only in the context of the
application, not all the windows.

Regards - OHM#
Hi OHM,

Are you sure

I find this terrible behaviour, did you try this.
\\\
Private Sub Form2_VisibleChanged(ByVal sender As _
Object, ByVal e As System.EventArgs) Handles MyBase.VisibleChanged
Me.TopMost = True
End Sub
Private Sub Form2_SizeChanged(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.SizeChanged
Me.WindowState = FormWindowState.Normal
End Sub
///
Although I think that is not what Newbie did ask

Cor

Regards - OHM# (e-mail address removed)
 
Hi,
Ok, I ll try to explain my problem.
I have a form (the main form) called A
On this form, I have my main menu.
When I run an option, I display the new form (B) on the center of A.
If do something else, run another application, I lose my B windows.. and I
have to use Alt + Tab combination, to find it.
I suppose it's due because I use the property for B, Not shown in the task
bar.
In fact, maybe, I don't use correctly the concept of MDI container, I don't
know.

What I want is to diplay my different Forms into the A form.
My form "A" calls my form "B" and "B" can call "C"
and for all cases I want all the child forms into A

Thanks for help
Stan
 
Hi OHM,

Of course it is about the program and not about you.

How could you think that I would write in that way about you

:-))

Cor
 
If I understand you correctly.. try this..

Set FormA.IsMDIContainer = True.... you can do this at design time.

Then when you want to show FormB do

FormB.MdiParent = FormA
FormB.Show

FormB will now be inside FormA..

Hope that's what you meant.
Rig.
 
ShowDialog() should keep the displayed form in focus when you return to the
application from another one.

Regards - OHM#

Hi,
Ok, I ll try to explain my problem.
I have a form (the main form) called A
On this form, I have my main menu.
When I run an option, I display the new form (B) on the center of A.
If do something else, run another application, I lose my B windows..
and I have to use Alt + Tab combination, to find it.
I suppose it's due because I use the property for B, Not shown in the
task bar.
In fact, maybe, I don't use correctly the concept of MDI container, I
don't know.

What I want is to diplay my different Forms into the A form.
My form "A" calls my form "B" and "B" can call "C"
and for all cases I want all the child forms into A

Thanks for help
Stan

Regards - OHM# (e-mail address removed)
 
Back
Top