• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1305
  • Last Modified:

SelectionChangeCommitted() Event not working?

I have several ComboBox controls on my a Form. Each of these are within a separate panel control (5 panels, 1 combobox per panel).

I'm using the SelectionChangeCommitted() Event for each of these comboboxes. My problem is that when I select a value, it executes the event but the value is nothing. I then select the same value again and then it has a value and it executes the way it is suppose to. Why is it taking 2 times to get a value? Here is just one of the Event Procedures below. I just use one because the rest are just like it...with the exception of the field name.

        Private Sub cmbTApprover_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cmbTApprover.SelectionChangeCommitted
                strErr = ""

                If cmbTApprover.Text.Length > 0 Then
                    ptLoc = cmbTApprover.PointToScreen(New Point(0, 0))
                    ptLoc.Y += cmbTApprover.Height + 5

                    gstrApprover = cmbTApprover.Text

                    If GetApproverPassword() Then
                        btnUpdate.Enabled = True
                    End If
                End If

        Catch ex As Exception
            strErr = gfrmID & "/cmbTApprover_SelectionChangeCommitted() - " & ex.Message & ",E"
        End Try

        ProcessMessages(Me, sbr, strErr)
    End Sub
  • 2
1 Solution
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Hi.. BlakeMcKenna...

This seems to be logic due to theory if your Combobox at your first Selection is Empty

ComboBox.SelectionChangeCommitted Event
Occurs when the selected item has changed and that change is displayed in the ComboBox.

Just for try ..set your SelectedIndex other than -1 and fire the event ..

BlakeMcKennaAuthor Commented:
jtoutou...you were right...it was a logic issue!

John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Glad i guide you!!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now