dcostelloe Level: VB Guru
 Registered: 11-06-2002 Posts: 74
|
Adding DropDownList to Custom Control
In a custom control you can create an event for any control the sample here will be the dropdownlist the most sought after question
In the General Section
Private WithEvents obj As DropDownList = New DropDownList()
' Note Using WithEvents allows you to correctly assign a handle event rather than using the AddressOf
' Create a Sub to Handle the SelectedChanged Event
Private Sub DropDownSelectMe(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles obj.SelectedIndexChanged
'Process Event here
End Sub
Special Note:
Don't forget to set the AutoPostBack to True otherwise the event won't fire: By default the AutoPostBack is set to False.
Custom Controls well worth looking into :rvd:
[Edited by dcostelloe on 06-09-2002 at 12:09 PM GMT]
____________________________
Life is but a merry go round
around and around :-)
Visit us today:
http://www.welford-costelloe.com
|