Click here to Skip to main content
15,887,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, from my case, lets take an example. If I select textbox(a value in combobox), a textbox will appear below it, else if I select label(a value in combobox), a label will appear below it. How can I make it happen?
Posted
Comments
Sergey Alexandrovich Kryukov 24-Dec-13 3:37am    
What have you tried so far?
—SA

1 solution

This can be done by controlling the visibility of those controls. This is the property to use: http://msdn.microsoft.com/en-us/library/system.windows.uielement.isvisible%28v=vs.110%29.aspx[^].

Also, you need to associate a selected combo box (list box could also be recommended) with the control to show or hide. You need to use some neat way of doing it. One the the approaches is: you can store some information objects in the list items, not just strings. Please see my past answer: combobox.selectedvalue shows {} in winform[^].

Sorry, this answer is written for System.Windows.Forms, but this approach works for WPF as well.

—SA
 
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