?
Solved

VB6 Combo Box Clear

Posted on 2004-04-20
5
Medium Priority
?
1,731 Views
Last Modified: 2012-06-21
I have in a Visual Basic 6 program a Combo box full of data and I want the user to be able to select through the drop down menu and get a choice. I  have about 5 of these. I am wanting to have a RESET button at the bottom where it will set all of the combo boxes back to blank but still keep the values in the list.

Please help.

0
Comment
Question by:Ckesey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 2

Accepted Solution

by:
taherzm earned 1000 total points
ID: 10870194
do u load data into the combo box at runtime?
if so then add a blank item at the begginning

cbo1.additem ""

cbo2.additem ""


otherwise at design time just add a blankitem at the top...

onclick of the reset button...

cbo1.listindex=0

cbo2.listindex=0

hope this helps....
0
 
LVL 2

Expert Comment

by:taherzm
ID: 10870248
also on loading the form if u want to select the first value then just write this in the form_load event

cbo1.listindex=1
cbo2.listindex=2

ps: pls replace cbo1,cbo2 with the respective names that u r using
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 10870594
Just set the Text value of the ComboBox to "".

Private Sub Command1_Click()
    For i = 0 To Combo1.UBound
        Combo1(i).Text = ""
    Next i
    ' If they are not part of a control array then you have to do each one individually
End Sub

Idle_Mind
0
 

Author Comment

by:Ckesey
ID: 10871098
Thanks. That worked.

0
 
LVL 2

Expert Comment

by:taherzm
ID: 10871124
glad to have helped...:)
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Simple Linear Regression
Introduction to Processes

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question