Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What event is fired when user control is completely visible

Status
Not open for further replies.

nomi2000

ISP
Joined
Feb 15, 2001
Messages
676
Location
CA
Hi guys
i want to knwo which event is fired when user control is completely visible and also this event should be fired once when the control is compltetly visible,because there are unwanted SelectedIndexChanged Events fire when there are combobobxes on the control when the control is loading
Althoug i did a tecnique by removing the Handle clause from the Comboboxes SelectedIndexChanged event but now i want to put the AddHandler but after the control is visible so that SelectedIndexCahanged not fired
Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Hi nomi2000,

I might have miss-understood your question, if I have - sorry :) You want to set the ComboBox's SelectedIndex without the actual event firing when your Form first loads?

One way to do this could be to have a Global Boolean variable set to False, and perform a check in your SelectedIndexChanged event procedure. Something like:

Code:
Private bAllowEvent As Boolean = False

Private Sub MyRoutine(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    If Not bAllowEvent Then
        bAllowEvent = True
    Else
        Exit Sub
    End If

    'Your code here.

End Sub

Hope it helps.

T0AD


There's a thin line between genius, and insanity!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top