Discussion Locked

VB - ComBox, Style = 2

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a Combox with STYLE as 2 - Dropdown List
and
in LIST there are values like
1
2
3
4
5
6

By default then the form is open the ComboBox is empty,

If in mistake I select any value from the list then How I can make it blank again????

Please help

3 replies

by madestroitsolutions

You can do one of two things:
If you want the users to be able to select a blank value too, if there is nothing for them there, then you can make one of the lists of the combo box a blank item, so they can select it. NOW, if you want to do it programatically, say by clicking a button, or as part of your code, then simply set the ListIndex property to -1. ex:

Private Sub Command1_Click()
Combo1.ListIndex = -1
End Sub

This will make the combo go blank again.

Good Luck!

This discussion is closed to new replies.