Runtime vs Design Time controls creation

R

rkbnair

I create some CheckBox controls at runtime. How can I define events for these
controls. For an event to be working, it has to be defined in the
InitializeComponent.
So, how can I specify these since the checkboxes are not created at design
time?
 
E

Elmer Carías

You can use that, After you add the control you can define an Event for this
control that use a Sub defined in your code
Example :
......
' In the InitializeComponent
AddHandler _Form.Closing, AddressOf Me._Form_Close


Private Sub _Form_Close(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs)
'Your Code
End Sub


Try with that, i hope so that helps you

Elmer Carías
El Salvador, CA
MSN: (e-mail address removed)
 
R

rkbnair

Can you explain it a little bit deeper? Also, is it possible to code in c#?

Thanks in anticipation.
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top