I have a VB project I am working on and I can't, for the life of me, remember how to force call a SelectionChanged event. Below is the code I am trying to call...
Private Sub cbxName_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles cbxName.SelectionChanged
Try
Dim cmb As ComboBox = sender
Dim i As Integer = cmb.SelectedIndex
Dim cust As Customer = Customers(i)
Me.DataContext = cust
Catch ex As Exception
End Try
End Sub
...and here is the code where I am trying to call it. (I'm doing it this way, because for some reason the sub isn't being called when my If/Then statement fires.)
Private Sub RetrieveProperties()
Try
If appDRAW.Documents.Count = 0 Then Exit Sub
dcmnt = appDRAW.ActiveDocument
If dcmnt.FileName <> "" Then txbPONum.Text = Left(dcmnt.FileName, Len(dcmnt.FileName) - 4) Else txbPONum.Text = ""
If dcmnt.Properties.Exists("Customer", 1) Then cbxName.Text = dcmnt.Properties("Customer", 1)
...
Catch ex As Exception
MessageBox.Show("Can't Retrieve Properties:" & vbLf & ex.Message)
End Try
End Sub
I'm thinking maybe something like...
If Customers.Contains(dcmnt.Properties("Customer", 1)) then cbxName.Text = [what ever the index of the query was.]
How do I figure out what the query selection index is? or how would I complete that if statement?