DropDownList doesn't have a Load method - so how does this code work?

N

Novice

Hi all, what is the equivalent of this C# in VB
----------------------------------------------
DropDownList CustomerIdChooser
CustomerIdChooser = new DropDownList()
CustomerIdChooser.Load += new EventHandler(CustomerIdLoad)
CustomerIdChooser.SelectedIndexChanged += new EventHandler(CustomerIdChanged)
----------------------------------------------
I'm trying to build some webcontrols and initially I was just going to use the RenderControl method of the DropDownList to populate the DropDownList with each of the possible selections

But then I came across the above C# code - is there a way to do something similar in VB.NET

I tried doing this
 
R

Raterus

look at AddHandler to do this in VB

AddHandler CustomerIdChooser.SelectedIndexChanged, AddressOf CustomerIdChanged

Private Sub CustomerIdChanged(whatever the event args are..)
'do stuff
End Sub

--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top