Click here to Skip to main content
15,886,004 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
After creating a form with over 50 controls I allways find another control is necessary. Using the tab control view to insert the control in the right order is very tedious.

I researched if there is a better way, but I couldn't find one.
So I'm currently creating an application that opens the designer.cs file I want to edit. The form is then rebuild, showing the taborder of all controls, but different from the tabview, clicking on a control gives a choice to edit the current taborder number, or insert a taborder number. On inserting all subsequent taborder numbers are increased by one. After completion the modified designer code will be written again.

When finished I will write an article about this program, so other developers can use this program as well.


The most important question:
Did I do my research right? Is there currently realy no better way to control the tab order than the tab view?
Other thoughts and considerations I should be aware of?

Thanks

What I have tried:

I currently have proof of concept working, as I'm using my own custom controls it includes an XML datatable translating the custom controls to standard Microsoft controls.
Currently I'm using reflection to create the controls this is quite time consuming (up to a minute for a complicated form), I try to change this into delegates, that should be a lot faster!
Posted
Updated 21-May-19 0:00am

1 solution

There is no other way - it has to be a visual process as the system has no idea what ordering you want.

But ... the question you clearly aren't asking is even more important: "Why are you putting 50+ controls on a single form anyway?"
The more controls you put on a form, the more "crowded" and "cluttered" it gets - and the more hassle it is for the user to work out what to do. Group them together (I tend top use UserControls to help with this and use tab pages or similar if necessary to get user input. Don't just slap 50+ text boxes on a form and expect the user to sort it out!
 
Share this answer
 
Comments
RobScripta 21-May-19 6:23am    
Thanks for your response, you are absolutely right, I should allways consider whether it's better to split the forms.

I think it depends on the user audience: is the consumer presented with the form, or is it a professional who works all day with the software.

In this case it's the input of new patients, their formal name, spouse's name, birth date, social security number, insurance data, address, pharmacy and GP etc. Combined with labels and buttons 50 items is not very much!
In maintaining the patients data I have split into several forms, and the users complain they don't have overview!

On line patients have also a possibility to enter their data, and we split that into multiple forms.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900