Solved

problem in working with childforms in vb.net

Posted on 2004-09-28
9
171 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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