[RESOLVED] [2005] TabControl Resize
I have a tab control on a form, when the form is resized, I re-arrange the controls on the form and on both tabs of the tabcontrol. However... only the controls on the visible tab appear to move. If I click to the previously unselected tab, the controls have not moved. If I then resize the form, they all jump into place.
This also happens if I start with the 'other' tab visible.
I tried adding invoking my resize sub on the tabcontrol resized event, but that does not make any difference. I also added my resize sub on a tab enter event and that does not alter the outcome.
Re: [2005] TabControl Resize
I think this is because the controls on a tabpage seem to be generated during run-time. The same happens when you try to click a button that is on a non-selected tabpage using PerformClick: it does not work.
How do you re-arrange the controls? Simply using Docking and Anchoring? Or do you do it in code? If you do it in code try running the same code on the SelectedIndexChanged event of the TabControl.
Or better yet: try doing it with docking and anchoring instead. I just tested it and using docking/anchoring the problem does not exist. I can't think of much scenarios when docking and anchoring is insufficient, but if you're having trouble show us what you want to do exactly.
Re: [2005] TabControl Resize
I do it programatically using a ReSize sub, referring to each control and moving them around to the correct positions for the form size.
I tried calling that sub in the tab control SelectedIndexChanged event and it worked! It was strange that the enter event for a given tab did not work though, weird.
Docking and Anchoring would be easier, but I can never seem to get this to work as I want. Also, I resize some listview columns in the resize event too, so I need to run something to control how they look.
Re: [RESOLVED] [2005] TabControl Resize
Show us what these tabs look like and we'll show you how to layout your form so you don't need to manually change the Size or Location of any controls. If the layout is complex then one or more TableLayoutPanels or FlowLayoutPanels may be required. If there are any proportions you want to maintain, please specify.