-
August 29th, 2017, 11:11 AM
#1
Nothing in the combobox when firing the leave event
I have a number of comboboxes that I use to capture user input. I am using the leave event to capture the user selection. If I use the mouse to move to the next combobox, I get a value. But if I use a tab to leave and enter the next combobox then I am not getting any value to evaluate. I can detect the value using combobox1.text to give me the entry but I am unable to add the value back into the combobox selection.
Example one combobox:
Code:
Private Sub cmbT22tx_Leave(sender As Object, e As EventArgs) Handles cmbT22tx.Leave
thisScore = Me.cmbT22tx.SelectedItem.ToString()
myComment = ""
If thisScore = "Fail- Self" Then
myComment = currResources.T22C + "(Self)"
End If
If thisScore = "Fail- Company" Then
myComment = currResources.T22C + "(Company)"
End If
If thisScore = "Fail- Incorrect brand" Then
myComment = currResources.T22C + "(Incorrect brand)"
End If
If myComment <> "" Then
rtbT1Notes.AppendText(myComment + vbNewLine)
End If
End Sub
Any suggestions to force the combobox to respond with a value when I tab out of the control which most of user will do rather a mouse click.
Last edited by 2kaud; August 29th, 2017 at 11:43 AM.
-
August 29th, 2017, 02:42 PM
#2
Re: Nothing in the combobox when firing the leave event
What happens after the user leaves all the comboxes - is there something you do then?
-
August 29th, 2017, 07:10 PM
#3
Re: Nothing in the combobox when firing the leave event
Originally Posted by Arjay
What happens after the user leaves all the comboxes - is there something you do then?
No. Basically this one combobox is a set of 14 on a tab. Each box has to respond real time by loading the appropriate information (ie... selected.item) that post to another section of the form, firing additional events. I just need to know how to get the Selected.Item.ToString to have the selected value when the user tabs out of the combobox. I have tried a few things but no solution.
-
August 29th, 2017, 11:16 PM
#4
Re: Nothing in the combobox when firing the leave event
I generally use the selected item changed event
Always use [code][/code] tags when posting code.
-
August 30th, 2017, 06:53 AM
#5
Re: Nothing in the combobox when firing the leave event
Originally Posted by DataMiser
I generally use the selected item changed event
I have tried all the selected.* events without success. I am working with the 2 step validation process and that seems to capture the selection. I will use appropriate [code] tags from here out. Sorry the mess, old programmer but first post to a forum..lol
-
September 4th, 2017, 09:00 AM
#6
Re: Nothing in the combobox when firing the leave event
I prefer the DropdownClosed event nowadays
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|