Z
zorrothefox.groups
Hi,
I have an Windows Forms application written in C# which has a
tabcontrol in it. The tabcontrol has many pages in it. Each tabpage
deals with a specific feature in the application. e.g. Download,
Upload, Erase etc.
If I add all the controls directly to the tabpages, then that
basically means that I'd have to handle all the logic in the main form
itself. However, this would mean that the entire code for the
application would be in one class.
Hence, I need to split up the tabpages into either separate Windows
Forms OR User Controls(based on some info in earlier posts), and then
load them at Main Form's Load event into the tabcontrol.
I tried loading the forms into the tabpages by doing something like
this...
form.TopLevel = false;
form.FormBorderStyle = FormBorderStyle.None;
form.Parent = tab;
tab.Controls.Add(form);
form.Show();
Now, the problem is that even though the form displays properly in the
tab page, some part of the form seems to be missing. The right and
bottom parts of the form are not showing, even though the form size
and controls are
capable of fitting into the tabpage bounds. Also, the controls are
much larger than in the form, as if they have been zoomed up. I am
having to severely reduce the size of the form to make it display
properly, even then the control sizes are not as on the form.
The exact same problem occurs even if I use a UserControl instead of a
form to host the controls, and do the following...
UserControl1 userControl = new UserControl1();
tabPageDownload.Controls.Clear();
tabPageDownload.Controls.Add(userControl);
//this line seems to make it fit slightly better into the
tabpage, but doesn't solve the problem
userControl.Dock = DockStyle.Fill;
I have run out of ideas here. Any help would be highly welcome.
Windows Forms Gurus, please show me the light!
Thanks in advance,
Bharat
I have an Windows Forms application written in C# which has a
tabcontrol in it. The tabcontrol has many pages in it. Each tabpage
deals with a specific feature in the application. e.g. Download,
Upload, Erase etc.
If I add all the controls directly to the tabpages, then that
basically means that I'd have to handle all the logic in the main form
itself. However, this would mean that the entire code for the
application would be in one class.
Hence, I need to split up the tabpages into either separate Windows
Forms OR User Controls(based on some info in earlier posts), and then
load them at Main Form's Load event into the tabcontrol.
I tried loading the forms into the tabpages by doing something like
this...
form.TopLevel = false;
form.FormBorderStyle = FormBorderStyle.None;
form.Parent = tab;
tab.Controls.Add(form);
form.Show();
Now, the problem is that even though the form displays properly in the
tab page, some part of the form seems to be missing. The right and
bottom parts of the form are not showing, even though the form size
and controls are
capable of fitting into the tabpage bounds. Also, the controls are
much larger than in the form, as if they have been zoomed up. I am
having to severely reduce the size of the form to make it display
properly, even then the control sizes are not as on the form.
The exact same problem occurs even if I use a UserControl instead of a
form to host the controls, and do the following...
UserControl1 userControl = new UserControl1();
tabPageDownload.Controls.Clear();
tabPageDownload.Controls.Add(userControl);
//this line seems to make it fit slightly better into the
tabpage, but doesn't solve the problem
userControl.Dock = DockStyle.Fill;
I have run out of ideas here. Any help would be highly welcome.
Windows Forms Gurus, please show me the light!
Thanks in advance,
Bharat