Solved

VB 6.0 ComboBox onchange

Posted on 2004-09-09
3
603 Views
Last Modified: 2013-12-25
Ola,

How do I know that the selectedIndex has changed from a VB 6.0 ComboBox, I am missing the needed events to do it.
Does someone know a workaround?

0
Comment
Question by:DaFou
  • 2
3 Comments
 
LVL 5

Assisted Solution

by:KarcOrigin
KarcOrigin earned 200 total points
ID: 12016487
Private Sub Combo1_Click()
    Debug.Print "I have changed"
End Sub
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 300 total points
ID: 12016507
Hi DaFou,

Use the ComboBox_Click() event rather than the Change event. The Change event fires when you enter in the text-edit section of a combobox which is not defined as a fixed list. The click event fires when one of the items is selected either using the keyboard or mouse as appropriate.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12016552
Hi,

Addition to my comment even if you change the ListIndex of the combo box the Click event fires.

Eg:
Combo1.ListIndex = 2

Ya TimCottee that is what I have shown DaFou in my first comment. Anyways, I hope we are helping him.

Keep the good work going on. Cheers!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now