By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

problem in working with childforms in vb.net

P: n/a

hello to all

i got some problem with child forms in my vb.net application.
in my application i need to maximize some child forms when they are loaded
(set the windowstate to maximized at design time).

if i do so then, the next form opened which is not be maximized and the
windowstate is also set to "normal" at design time also getting maximized
(awwwwww it sucks). why this happens so ?. (i guess its setting the prev.
forms window state .... )

i have set the maximizebox to "flase" for all the forms which i don't want
to maximize and set the formboaderstyle to "fixedsingle"

to solve my problem what should i do ?

in short >> i want to retain the childforms windowstate property set at
design time (not to be changed automatically at run time)

please some body help me out ...

adv. thanks

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Sympatico,

In the way you understand it is it in my opinion something as setting a
switch which tells about the windowstate of your forms and use that when you
"load" a form. (The registry is a very good place for that in my opinion,
because than the next time it is as well in the previous state)

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
Hi Cor,

I find that this is not true. The status of the active child form controls
the status of all others. If you maximize a child form, all of them become
maximized; if you change to normal, all the others change to normal.

Bernie Yaeger

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...
Sympatico,

In the way you understand it is it in my opinion something as setting a
switch which tells about the windowstate of your forms and use that when you "load" a form. (The registry is a very good place for that in my opinion,
because than the next time it is as well in the previous state)

I hope this helps?

Cor

Nov 21 '05 #3

P: n/a
Bernie,

You are right, thank you for making me attent on it, made a to quick simple
answer without real thinking maybe. You should see the wound on my head from
hitting on it.

Thank you for making me attent on this mistake, I keep it in mind.

Cor
Nov 21 '05 #4

P: n/a
sympatico,

Bernie made me attent I gave you a wrong messages.
Maybe you can use this (changed and shorten) code I use for it.

\\\
Private Sub mnuFrmHandling(ByVal frmName As String)
For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next
Dim frmNew As Form
Select Case frmName
Case "Persons"
frmNew = New frmPersons
Case Else
frmNew = New frmStandard(frmName)
End Select
frmNew.MdiParent = Me
frmNew.Show()
frmNew.WindowState = FormWindowState.Maximized
frmNew.Name = frmName
frmNew.BringToFront()
End Sub
///
I hope this helps?

Cor
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.