Its that I am developing an application in C# and I have used three tab controls there. The problem is I can not change the actual window size of the application when I change to another tab because I do not need such big window for that and when I change back to the previous one it should go back to previous size.
- 2I personally feel that constantly changing the window size would not provide a very pleasant user experience, if they maximize (unless you don't let them) then they will get a full-screen window anyway. I would suggest setting the window size to the maximum you need and just have tabs that don't fill the full window with content all the timePaul C– Paul C2012-01-06 10:09:43 +00:00Commented Jan 6, 2012 at 10:09
- Do not use tab control. Use panels and show/hide them via buttons. You simply have to set autosize and AutoSizeMode property of Form.KV Prajapati– KV Prajapati2012-01-06 10:21:25 +00:00Commented Jan 6, 2012 at 10:21
- Is this WinForms or WPF?Gayot Fow– Gayot Fow2012-01-07 01:12:31 +00:00Commented Jan 7, 2012 at 1:12
Add a comment |
2 Answers
In my opinion you should not change the size of the window when the selected tab changes. Design your window in such a way that you don't need to resize it.
Redesign your tabs in such a way that they always consume the same size so you don't need to resize the window.
I would not expect, as a user, that the window size changes because it may give you a bad user experience.
3 Comments
shihab13rocks
I get the point but its a project and I was asked to do it. So, can you please help?
rekire
Try to redesign you tabs in such a way that the consume allway the same size. So you don't need to resize the window. Does that help you?
shihab13rocks
I tried that but you see the contents of one tab take so much space and the others don't and I have to keep those that way.
i think you want this:
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedTab.Text == "tabPage1") { // rezise tabcontrol } } although i dont think its user-friendly
1 Comment
Moonlight
@shihab13rocks see my edit, now using selectedIndexChanged, this works (for me)