DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    5

    Problems with the events of dinamically created control

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

    I´m 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, 05:05 PM
  2. Runtime Created Horizontal UpDown Control
    By James Thresher in forum VB Classic
    Replies: 0
    Last Post: 10-03-2001, 07:59 AM
  3. Replies: 0
    Last Post: 05-16-2001, 05:24 PM
  4. Replies: 0
    Last Post: 02-04-2001, 09:56 AM
  5. Replies: 0
    Last Post: 04-18-2000, 06:01 AM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links