Link to home
Start Free TrialLog in
Avatar of imarshad
imarshadFlag for Pakistan

asked on

A form inside a form.........

Hi all,
        In my software I am trying to display an infobox(Form) on my main form...... Well I have done so but the problem is that if my main form is set to a small size and I drag the infobox(form) then it goes outside from the boundary of my main form. I want it to be within my form boundary and never display when the main form is minimized...


Here is how I am displaying my form

Latest.Show 0, Form1

Another problem is that this code (Latest.Show 0, Form1) is called after about 1 min. in  a function..... Now if my main Form is minimized even then the infobox is displayed which is not what I want.....
I know one solution to this by using MDI-Child but is there some other way of doing so?????

Imran
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of imarshad

ASKER

Excelent Tip..... Exactly what I wanted.... Just one question... will I need to call SetParent every time I display my form (using form.Show )??? or calling it only the first time will suffice?

Imran
Each time you create a NEW instance of your form you must use SetParent().  If you create the instance and set its parent then you can Hide/Show it as many times as you like until it is closed.
Thanks....

Imran