Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Fix tab order on form with many pages and many panels

$
0
0
I have a form that has 32 pages (don't go there, it is a configuration form and seldom used).  On every page of the tab control there are panels and inside the panels are controls.  The problem is, when the controls were added, some got put inside the panel and some are visually inside the panel but actually reside on the page.  This causes the tab order to be incorrect.  I have tried cutting the controls visually in the panel and dropping them back in (to put them ALL inside the panel) but that is a mess because placement is all over the place due to their original position being defined inside the panel and some inside the page so some are not even visible to locate and move again.  I have tried cutting the contols and deleting the panel, pasting the controls back on the page (this is a problem because placement is all over the place due to their original position being defined inside the panel and some inside the page).

Any ideas on how I can fix this?  There are so many pages and some pages have 3 or 4 panels and on every page there are some controls outside of panels so it is very difficult to fix.  I only need to fix the tab order.

I tried to do this outside the IDE as well by programmatically deleting the panels in the designer.cs but I have to determine what page the controls belong in so I can also change the code that added the controls to the panel to add the controls to the page instead and also position them correctly on the page (based on their position when they were in the panel).  It was just too difficult.

Another option I thought of that could be done programmatically is to change the panels to another control that could 'hold' the other controls that sit in the panel (which then wouldn't require repositioning them) but that doesn't affect the tab order - or in other words, the controls follow the tab order on the page and not 'within the new control they reside in.'  Does such a control exist?

I have successfully modified the designer.cs (outside of the IDE) programmatically with other forms when I needed to do mass changes before, but this one is just too complicated.

Thanks for all ideas!

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>