Grey out listbox in userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a userform. I want to prohibit the user from one of the listboxes at
certain times. I know I can set the .Enabled propterty = False. But how to
you grey out the listbox?

Thanks

EM
 
Maybe hiding it would work better.

ListBox1.Hide

If they can't see it they can't use it.
 
Sorry, Hide is for the whole UserForm

ListBox1.Visible = False

Would hide the control.
 
.... and maybe you could then display a label with the listbox value instead.
 
Hi,

Try changing the forecolor to give a visual clue to the listbox's state.

If ListBox1.Enabled Then
ListBox1.ForeColor = SystemColorConstants.vbWindowText
Else
ListBox1.ForeColor = SystemColorConstants.vbGrayText
End If

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Userform Listbox selection change 2
Userform 4
inconsistent dir() behavior 1
Common Function for getting userform information 6
Listbox Problem 1
UserForm 8
Edit Listbox in Userform 10
Set Cell value form ListBox. 4

Back
Top