Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 3-Jan-13 21:10pm
Tejal S1.9K
Edited 4-Jan-13 10:46am
v2
Comments
Sergey Alexandrovich Kryukov at 4-Jan-13 4:09am
   
There are different types names "ListBox". Full name, please.
—SA
Naz_Firdouse at 4-Jan-13 4:44am
   
page.schemelistbox.Visible=false
BillWoodruff at 4-Jan-13 16:47pm
   
I think this is the correct answer, and probably all the user needs.
ChrisTopherus at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
BillWoodruff at 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 at 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 at 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)

  Print Answers RSS
0 Maciej Los 404
1 OriginalGriff 369
2 Sergey Alexandrovich Kryukov 158
3 CPallini 145
4 Hard_Rockz 85
0 OriginalGriff 5,634
1 Sergey Alexandrovich Kryukov 4,763
2 Peter Leow 2,954
3 Maciej Los 2,614
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web04 | 2.8.140718.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid