Solved

problem in working with childforms in vb.net

Posted on 2004-09-28
9
173 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:gkmohan2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 2

Expert Comment

by:ahmadfuwad
ID: 12168852
write following code on an event on anactivated
me.windowstate=maximized
0
 
LVL 10

Expert Comment

by:123654789987
ID: 12168963
Try calling the child form from the parent as a modal dialog. This way it will appear in its normal state

Dim dlg1 as new ChildForm()
   dlg1.ShowDialog()
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12169183
Is this a MDI project ?

If it is, then there is nothing you can do about it, it is by design, all child windows cascade the windowstate (except minimize and close)

one child maximized then all children maximized.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:wguerram
ID: 12173229
You can do this to avoid the problem

This code check the state of the form to be showed, if normal state, make the active form to be in normal state.

So your form won't be showed maximized.

        Dim f As New Form3        
        If f.WindowState = FormWindowState.Normal Then
                Me.ActiveMdiChild.WindowState = FormWindowState.Normal
        End If
        f.MdiParent = Me
        f.Show()
0
 

Author Comment

by:gkmohan2003
ID: 12180832
thank you all
yes ronald ... as you said its behaving the same
even though i set the form state in form load to normal if any child form is maximized then this form is also maximizing .. omg.

and if one child form is restored to normal size then all the children are restored ...awwwwwwww
but as its the basic functionality of the mdi children ... i can't do any thing with it .... do you mean the same ?

so i have changed my other forms to normal only (which were needed to load as maximized earlier) hope the problem will be solved ...
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 125 total points
ID: 12181000
Hi gkmohan2003, yes it is a bit of a bugger, what I usually do is disable the minimize and maximize box, set the windows formborderstyle to fixed single, and size the forms to there required size in design time.
0
 

Author Comment

by:gkmohan2003
ID: 12470164
sorry to all
As i was busy with other work, i couldn't attend my post.
thanks alot
Mohan G
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question