Change ReadOnly Property of ListBox?

Joined
Dec 10, 2007
Messages
18
Location
Florida
Programming Experience
Beginner
Hello all,
What im trying to do is not allow a user to click on a listbox.
Here is my code:
VB.NET:
ExampleListBox.CanSelect = False
But the property is immutable, so I cannot change it. I tried creating a new listbox so that I can use its CanSelect property but, I havn't been able to figure it out because I am unable to change the property of that listbox either. Any help would be greatly appreciated. Thanks
 
Last edited:
How does SelectionMode=None fit in the puzzle? Or Enabled=False?
 
If i use selectionMode = None ; it ruins another part of my program where I need it to be selected.

Heres the idea.

There are 3 list boxes. I only want the first one to be allowed a selection and when it is selected , it will select the same record in the other two list boxes. I have accomplished that task.

I do not want the user to be able to click on the other two list boxes because then it focuses on it and ruins the record selected item "view" that I had before.

If i use selectedMode = None then , it does not allow me to add anything into the list box, i get run-time error.
------
If i used enabled = false , then it works. The user cannot select the item but, the text inside the listbox appears grayed out.

-----
if you can find a way to change the CanSelect property it would be great because I need to do the same thing to two radiobuttons as well.. :confused:
 
Back
Top