Combobox Selection

vellaima

Centurion
Joined
Jan 29, 2003
Messages
109
When the user selects the item_id in the combobox i would like to display the item_desc in the text box. When i use Selected Index Changed i think (i am not sure) it is getting triggered when the form is loaded. Can anyone please tell me how to fix this.
 
The dirty way is to set a boolean flag.

Visual Basic:
Class MyForm

Private mLoading as Boolean = True



Sub DoThisAndThatForLoading()
[somecode]
   mLoaded = false
end sub
and then check that variable in the click eventhandler.


And I am sure there is an even more elegant way, I think I have read somewhere that you can determine whether a form is currently being "built for display".
 
I have tried the below code and it is working perfectly now. I don't know whether it is the correct method.

Visual Basic:
Private Sub idcombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles idcombo.SelectedValueChanged
        If idcombo.ContainsFocus = True Then
                commission.Checked = False
        End If
End Sub
 
Back
Top