Keep main form open and visible

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 33
Reputation: SubProf is an unknown quantity at this point 
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Light Poster

Keep main form open and visible

 
0
  #1
Nov 7th, 2008
Hi everyone,

I have four forms. Form1 is the main form and needs to be kept open and visible at all times but cannot be clicked while the other forms are open. For example, the main form is open and after a certain amount of time the second form opens in front of it (and the main form is still visible). Then I click on a button on the second form to open a third form and the main form minimises and is not visible to the user while the third form only is visible to the user. I need the main form to remain open and visible in the background when the user is using the other forms. I have tried using this.visible = true but I cannot get the main form to stay visible.

Does anyone have any ideas as to how I might be able to overcome this problem? thanks in advance.

SubProf
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 138
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Keep main form open and visible

 
0
  #2
Nov 7th, 2008
just make sure not to call form.Hide()

you might also show other forms as dialogs depending on your needs
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 21
Reputation: viswa_007 is an unknown quantity at this point 
Solved Threads: 3
viswa_007's Avatar
viswa_007 viswa_007 is offline Offline
Newbie Poster

Re: Keep main form open and visible

 
0
  #3
Nov 7th, 2008
go to main form's properties and set ismdicontainer=true
and then for every form's (object when created and called to form.show() before that set the form's mdiparent to the main form) for e.g.
form1 obj=new form1();
obj.mdiparent=mainform
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Keep main form open and visible

 
0
  #4
Nov 7th, 2008
I guess it depends a little why you would have such a structure, however, if the forms have to remain forms, but work except the main form, you can of course disable it.. and have a counter so that when you close the other forms, they decrease the counter so that you can then use the main form when and only when all the blocking forms have closed.

The bad side of that is you would also need to be careful come the windows shutdown message
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 33
Reputation: SubProf is an unknown quantity at this point 
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Light Poster

Re: Keep main form open and visible

 
0
  #5
Nov 10th, 2008
Originally Posted by viswa_007 View Post
go to main form's properties and set ismdicontainer=true
and then for every form's (object when created and called to form.show() before that set the form's mdiparent to the main form) for e.g.
form1 obj=new form1();
obj.mdiparent=mainform
Thanks viswa_007 - that worked!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC