Solved

VB6 Combo Box Clear

Posted on 2004-04-20
5
1,729 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 250 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes

690 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