Problems with the events of dinamically created control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Problems with the events of dinamically created control

  1. #1
    Join Date
    Aug 2006
    Posts
    5

    Problems with the events of dinamically created control

    Hi, Im new in this forum and I hope you can help me,

    Im doing a software with VB.Net 2003 and I have created a few listboxes dinamically. The problem comes when I have to use the events of those listboxes, I want to use ListBox1.Click event.

    How can I do it?

    Thanks,

    TanKiE

  2. #2
    Join Date
    Sep 2004
    Posts
    77
    You need to tie the events of the dynamically created controls to your handler subs.

    From memory it will be something like:
    Dim x as AControl
    x = New Control
    Me.Controls.Add(x)
    AddHandler x.Click, AddressOf Me.HandleDynamic_Click

  3. #3
    Join Date
    Aug 2006
    Posts
    5
    Thank you very much pfff 1 hour with this problem and it was so small :P

Similar Threads

  1. Replies: 4
    Last Post: 08-12-2002, 06:05 PM
  2. Runtime Created Horizontal UpDown Control
    By James Thresher in forum VB Classic
    Replies: 0
    Last Post: 10-03-2001, 08:59 AM
  3. Replies: 0
    Last Post: 05-16-2001, 06:24 PM
  4. Replies: 0
    Last Post: 02-04-2001, 10:56 AM
  5. Replies: 0
    Last Post: 04-18-2000, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center