Create dymamically picturebox with events.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Create dymamically picturebox with events.

  1. #1
    Join Date
    Jan 2005
    Posts
    56

    Create dymamically picturebox with events.

    I want to load all picture files contained in a folder. I created a panel and want to add the picture files in pictureboxes inside the panel.

    But i don't know how many images there are in the folders, so i have to add dynamically the pictureboxes in the panel (i want one picturebox per picture files)

    But i also would like to add event on those picturebox (onclick and DragDrop).


    How do i do that ?


    Thanks for your help.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Use Controls.Add to add the pictureboxes, then use AddHandler to create the event handlers.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jan 2005
    Posts
    56
    Thanks for the info ! I will try that !

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