Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am Newbie so please excuse my silly explanation. I am designing one GUI application that has to handle a lot of events,

Example: When user select a sensor choice, all the sensor configuration are given to the user to put some values. Now, I have a lot of different type of sensors, each have different options for configuration.

Approach Used: What I have done is on the same (one) form, I have dragged all the possible combination of the configurations that are possible. And then baed on the user's selection from the combo box, Only make relevant configuration control Visible and change the labels text.

This approach has made my code very lengthy, and I think there has to be a better way to solve it. What are my possible options if any ?

Any help will be appreciated.

Thanks in advance
Posted

Not sure what your UI platform is, but assuming it's WPF and you are using MVVM or a similar approach, it would be fairly easy to bind the Visibility of each control to an object/property that can decide whether that control should be visible or not.
 
Share this answer
 
Hi,

Maybe it is better to create your label and check box and ... on the fly! so you do not need to create those that is not needed.
you just need to place them in your form.
 
Share this answer
 

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