473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to attach an event to dynamically created control in VB.NET

How to attach an event to dynamically created control in VB.NET

I have dynamically created dropdown list in code behind (VB.NET). For this
control I want to attach an event for action ‘OnSelectedIndexChanged’.

What is the property to assigne an event to a dynamically created dropdownlist

Nov 19 '05 #1
1 1823
You can do this using the AddHandler keyword.
eg.
AddHandler myDropDownList.SelectedIndexChanged, AddressOf
Me.myDropDown_OnSelectedIndexChanged

--
Philip Q
Microsoft MVP [ASP.NET]

"Nirmalkumar" <Ni*********@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
How to attach an event to dynamically created control in VB.NET

I have dynamically created dropdown list in code behind (VB.NET). For this
control I want to attach an event for action 'OnSelectedIndexChanged'.

What is the property to assigne an event to a dynamically created
dropdownlist

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aymer | last post by:
i created a new button object. how do i attach an event on it? thanx for your help. Dim cc As ColorConverter = new ColorConverter() Dim b = new button() b.ID = "SelectedDate" b.BorderStyle...
4
by: bhatiaajay | last post by:
I am new to JavaScript objects. The object creates a button with no events attached. Later I want to attach an event to the button created by this object. The event attaches a function in the...
3
by: Jane | last post by:
Hi I am using a Visual Studio .Net 7.0 trail version in Windows XP. I've dynamically created some menu items. Now I want to attach an event to these items, what should I do? Thanks Jane
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
15
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
0
by: matthewr | last post by:
Hi, My program creates an instance of an ActiveX control at runtime, using: Type = System.Type.GetTypeFromProgID(controlName); Control = System.Activator.CreateInstance(Type); Given a...
18
by: Redhairs | last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event during the postback?
1
by: sindhu | last post by:
Hello, I am able to attach event to dynamically created element.as shown below. for(var i=0;i<10;i++) {for(var j=0;j<15;j++) { var div=document.createElement('div'); ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.