borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Declare an istance of object)Next Topic (.NET compability with old win versions) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Adding DropDownList to Custom Control
Poster Message
dcostelloe
Level: VB Guru

Registered: 11-06-2002
Posts: 74

icon 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

06-09-2002 at 12:06 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB.Net : Adding DropDownList to Custom Control
Previous Topic (Declare an istance of object)Next Topic (.NET compability with old win versions) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder