Click here to Skip to main content
15,886,774 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, i want an urgent help in the below quest.
I'm on a UI where if i select any value in a dropdown list, it shows a listbox of data linked to it.

Currently we have grid [edit: set the 'Enabled property of the ListBox to 'false, which causes it to appear greyed-out] out the listbox, but we require to make this list box invisible.

How should i continue.
Currently we are using
page.schemelistbox.Enabled=false
page.schemelistbox.visible=false

How to make this schemelistbox invisible????? .
Posted
Updated 4-Jan-13 10:46am
v2
Comments
Sergey Alexandrovich Kryukov 4-Jan-13 4:09am    
There are different types names "ListBox". Full name, please.
—SA
Naz_Firdouse 4-Jan-13 4:44am    
page.schemelistbox.Visible=false
BillWoodruff 4-Jan-13 16:47pm    
I think this is the correct answer, and probably all the user needs.
ChrisTopherus 4-Jan-13 13:11pm    
or myListBox.Visibility = Visibility.Hidden

in general: please try to post a snippet of code to questions like that!

1 solution

I answered this yesterday. Has it been asked again ? Please don't ask the same question again, edit the old question to ask for more info or add detail. In this case, the visible property may not work if enabled is false, but it does work and do what you want.
 
Share this answer
 
Comments
BillWoodruff 4-Jan-13 18:40pm    
"the visible property may not work if enabled is false"

The Enabled and Visible Properties of a WinForms Control do not interact. Setting 'Enabled to 'false does not prevent you from making a Control visible, or hidden. Of course, if a Control is hidden, you could say that its being "Enabled" has no "meaning."
Christian Graus 4-Jan-13 19:01pm    
Then there is no reason for his code not to work, right ? I didn't think so, but it was the only reason I could see for this to be a valid question
BillWoodruff 4-Jan-13 19:22pm    
Hi Christian,

My comment only addressed a technically incorrect statement about the 'Enabled and 'Visible Properties in WinForms .NET.

His code doesn't work because of a spelling error.

Unfortunately, that's not the last question we'll see where the only thing wrong is a spelling error :) Happy New Year, Bill

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