Search code examples
vb.netdrop-down-menureadonly

vb.net How to make a DropDownList with readonly appearance


I am developing desktop application using vb.net and vs2008.

I have a DropDownList that I don't want it interact with use when the info is locked.

But if I disable it, it is greyed out and the text is not easy to read.

Is there any way to make radiobutton like readonly textbox?

I want text of the DropDownList looks black and itself is not clickable.

enter image description here

The above shows a disabled DropDownList with greyed out text and a readonly textbox


Solution

  • I recently encountered a similar issue. My solution was to remove all other values of the DropDownList except the one that is selected. This will keep the text as black as opposed to grey. Users will be able see the existing value and click it but will not be able to change it.

    Hope this helps.