ComboBox not triggering Combo_Change Event? (Resolved)
Ok, lets say I have a ComboBox with an item "hello" and the Text of the ComboBox is "hell"... When I click on the Button to drop down the list the Text automatically changes from "hell" to "hello" but the change event is NOT triggered..,
Try it:
VB Code:
Option Explicit
Private Sub Combo1_Change()
Debug.Print "Text in Combo1_Change = """ & Combo1.Text & """"
End Sub
Private Sub Combo1_Click()
Debug.Print "Text in Combo1_Click = """ & Combo1.Text & """"
End Sub
Private Sub Combo1_DropDown()
Debug.Print "Text in Combo1_DropDown = """ & Combo1.Text & """"
End Sub
Private Sub Combo1_GotFocus()
Debug.Print "Text in Combo1_GotFocus = """ & Combo1.Text & """"
End Sub
Private Sub Combo1_Scroll()
Debug.Print "Text in Combo1_Scroll = """ & Combo1.Text & """"
End Sub
Private Sub Combo1_Validate(Cancel As Boolean)
Debug.Print "Text in Combo1_Validate = """ & Combo1.Text & """"
End Sub
Private Sub Form_Load()
With Combo1
.AddItem "hello"
.Text = "hell"
End With
End Sub
How can I know when the user clicks on the DropDown and changes the Text of the ComboBox?
Thanks in advance!
Last edited by Tec-Nico; Oct 3rd, 2004 at 01:49 PM.
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
ComboBox — changes the text in the text box portion of the control. Occurs only if the Style property is set to 0 (Dropdown Combo) or 1 (Simple Combo) and the user changes the text or you change the Text property setting through code.
With this in mind.. I would like to do either one of these two things:
[list=a][*]Not allow the combo to change from "hell" to "hello" when dropping down[*]Know when the Combo changed its Text (So I can replace it for the other one)[/list=a]
I hope this can be done...
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
I tried to make this general by using Combo1.Parent.hWnd but for some reason it doesn't work.
Oh, and one more thing... I wasn't talking to myself, I was just explaining what I got to the people who might find the thread and have the same problem.
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico