Windows Forms Question

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 13
Reputation: chuck577 is an unknown quantity at this point 
Solved Threads: 0
chuck577 chuck577 is offline Offline
Newbie Poster

Windows Forms Question

 
0
  #1
Nov 27th, 2006
I have a quick question regarding windows forms. Say I have a main form and it has a toolstrip with 2 buttons on it. Lets say one button displays a calendar form in the main form and the other displays a list of contacts in the main form. What is the best way to do this? Do i need to hide the one form when another form link is clicked or is there an easier way to do this? I just want more than one form to be shown in the mainform buy clicking on the corresponding button. Also the calendar and contact form will actually be in a splitcontainer panel inside the main form.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 29
Reputation: brainbox is an unknown quantity at this point 
Solved Threads: 1
brainbox's Avatar
brainbox brainbox is offline Offline
Light Poster

Re: Windows Forms Question

 
0
  #2
Nov 28th, 2006
It really depends how you want to do this, if you want to display both the calender and contact information in the "Main Form", one by one, then you can show & hide the related component accordingly, e.g. if you click on the calender then contact form or details would be hidden or cleared, depending again whether you want to save the data or not before changing the focus to other item.
However, if you want to display both of these together then FLow Panel is the best option as it will show whatever you want, accordingly, as it arranges the components itself. All you would have to do this, is to add the components in the flp.controls.add(component);, as you would be adding the components depending on the buttons or components event on the tool strip you can add different components to this panel.

HTH

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: chuck577 is an unknown quantity at this point 
Solved Threads: 0
chuck577 chuck577 is offline Offline
Newbie Poster

Re: Windows Forms Question

 
0
  #3
Nov 28th, 2006
Thanks a bunch. This really helped out.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: chuck577 is an unknown quantity at this point 
Solved Threads: 0
chuck577 chuck577 is offline Offline
Newbie Poster

Re: Windows Forms Question

 
0
  #4
Nov 28th, 2006
Originally Posted by brainbox View Post
It really depends how you want to do this, if you want to display both the calender and contact information in the "Main Form", one by one, then you can show & hide the related component accordingly, e.g. if you click on the calender then contact form or details would be hidden or cleared, depending again whether you want to save the data or not before changing the focus to other item.
However, if you want to display both of these together then FLow Panel is the best option as it will show whatever you want, accordingly, as it arranges the components itself. All you would have to do this, is to add the components in the flp.controls.add(component);, as you would be adding the components depending on the buttons or components event on the tool strip you can add different components to this panel.

HTH

Thanks
One more quick question. I've been researching on the web and do you think I should make different user controls or make a form for each screen (calendar/contacts). Both of them can be added to panel1.Controls.Add(xxxxx). What do people usually do? I am trhinking making a user control because the form seems kind of like a hack job. Whats your opinion?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 29
Reputation: brainbox is an unknown quantity at this point 
Solved Threads: 1
brainbox's Avatar
brainbox brainbox is offline Offline
Light Poster

Re: Windows Forms Question

 
0
  #5
Nov 29th, 2006
Well, if you are using hide() and show() behind the buttons or whatever controls you are using, to control the displaying of calendar and contact information, then you would not need different forms unless you need to restrict some user to view particular forms (calendar/contacts), if so you can only allow to show them the related ones, otherwise, having one form with changing components behind the appropriate buttons should do.

HTH
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC