Runtime vs Design Time controls creation

Discussion in 'ASP .Net Web Controls' started by rkbnair, Jan 14, 2005.

  1. rkbnair

    rkbnair Guest

    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?
    rkbnair, Jan 14, 2005
    #1
    1. Advertising

  2. 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:




    "rkbnair" <> wrote in message
    news:...
    > 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?
    >
    >
    Elmer Carías, Jan 15, 2005
    #2
    1. Advertising

  3. rkbnair

    rkbnair Guest

    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:
    >
    >
    >
    >
    > "rkbnair" <> wrote in message
    > news:...
    > > 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?
    > >
    > >

    >
    >
    >
    rkbnair, Jan 15, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Domien Holthof

    Runtime control creation

    Domien Holthof, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    Domien Holthof
    Jul 1, 2003
  2. VQLC
    Replies:
    0
    Views:
    446
  3. Martin
    Replies:
    1
    Views:
    487
    Natty Gur
    Jun 22, 2004
  4. Alan Seunarayan
    Replies:
    5
    Views:
    570
    =?Utf-8?B?Sm9obiBUZWFndWU=?=
    Jul 27, 2005
  5. flamesrock
    Replies:
    8
    Views:
    449
    Hendrik van Rooyen
    Nov 24, 2006
Loading...

Share This Page