|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Handling Events for Dynamically Created ControlsI have several Button controls that I created dynamically that I need to
handle the Click events for. How do I specify the event handler for dynamically created controls? Thanks. "Nathan Sokalski" <njsokal***@hotmail.com> schrieb Use the Addhandler statement.>I have several Button controls that I created dynamically that I need > to > handle the Click events for. How do I specify the event handler for > dynamically created controls? Thanks. Armin "Nathan Sokalski" <njsokal***@hotmail.com> schrieb: \\\>I have several Button controls that I created dynamically that I need to > handle the Click events for. How do I specify the event handler for > dynamically created controls? Private Sub Test() Dim Button1 As New Button() With Button1 .Location = New System.Drawing.Point(56, 88) .Name = "Button1" .Size = New System.Drawing.Size(144, 48) .TabIndex = 0 .Text = "Button1" End With AddHandler Button1.Click, AddressOf Me.Button_Click Me.Controls.Add(Button1) End Sub Private Sub Button_Click( _ ByVal sender As Object, _ ByVal e As EventArgs _ ) MsgBox("Hello World") End Sub /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Click checkbox's label - javascript onclick gets called twice
AutoPostBack How can I use my Own control in DataGrid? Validation not working in paging Using a Stylesheet in a User Control The nowrap Property of TD Tags Text control - password Referencing Datagrid Rows while Datagrid is Sorted TextBox.Text not getting the proper value Positioning Panel on WebForm at runtime |
|||||||||||||||||||||||