| | |
Windows Forms Question
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
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.
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
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
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
•
•
•
•
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
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
HTH
![]() |
Similar Threads
- About Windows Forms C# .net 2003 (C#)
- Arranging Windows Forms (C#)
- pointers to windows forms (C)
- Using Windows XP Visual Styles with Controls on Windows Forms (VB.NET)
- Displaying pictures on Windows Forms using subprocedures in VB.NET (VB.NET)
Other Threads in the C# Forum
- Previous Thread: final year proj in .net using c#
- Next Thread: How to open a link in a pdf in a new window
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml





