![]() |
Runtime vs Design Time controls creation
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? |
Re: Runtime vs Design Time controls creation
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: elmer_carias@hotmail.com "rkbnair" <rkbnair@discussions.microsoft.com> wrote in message news:FE6BA130-E2A1-4C0A-A95E-0A16FA55BAD1@microsoft.com... > 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? > > |
Re: Runtime vs Design Time controls creation
Can you explain it a little bit deeper? Also, is it possible to code in c#?
Thanks in anticipation. "Elmer CarÃ*as" wrote: > 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: elmer_carias@hotmail.com > > > > > "rkbnair" <rkbnair@discussions.microsoft.com> wrote in message > news:FE6BA130-E2A1-4C0A-A95E-0A16FA55BAD1@microsoft.com... > > 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? > > > > > > > |
| All times are GMT. The time now is 03:09 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.