Important alert: (current site time 4/27/2015 9:33:23 PM EDT)

winzip icon

Button Control Array w/ Event Handler

Submitted on: 7/28/2002 8:30:40 PM
By: Ramon E. Tristani 
Level: Advanced
User Rating: By 9 Users
Compatibility: VB.NET
Views: 14227
author picture
(About the author)
     Button control array with event handling. This code will show you how to create control arrays in Visual Basic.Net and have each array member respond to events by using the AddressOf operator. Though it looks like a calculator, it has no calculation functions. The purpose of this project is not to show how to create a calculator.
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
// for :Button Control Array w/ Event Handler
If you find this useful in any way, and decide to
use it, please remember to give credit to the
author of the code, ME. It's all I ask.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net

Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Other 8 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

9/17/2002 4:59:47 PM

way to go! this is helped me out a lot!
(If this comment was disrespectful, please report it.)

9/17/2002 6:05:43 PMRamon E. Tristani

Happy to be of assistance

(If this comment was disrespectful, please report it.)

10/1/2002 10:39:10 AMPooh

Nice! I'd been wondering how to accomplish this, as I have a few projects here at work that have dynamic forms... No time to think it through myself, but this code will be very useful!

5/5 from me!
(If this comment was disrespectful, please report it.)

10/12/2002 1:23:09 AMRamon E. Tristani

Thank you for your vote.
(If this comment was disrespectful, please report it.)

12/26/2002 8:58:38 PM

How can you this with TEXTBOXES. Use to be real simple in VB6.
(If this comment was disrespectful, please report it.)

9/2/2004 11:58:56 PMRoss Peoples

Nice code...I have only one problem. The very SECOND that I type AddHandler .Click, Addressof Me.Label1_Click I get an error message saying that there was an error in the internal compiler and that I need to restart .NET.
(If this comment was disrespectful, please report it.)

3/29/2005 7:14:43 AM

Excellent dude! I used it to dynamically define the number of field to my report and it worked flawlessly. Good job man! keep it up.
(If this comment was disrespectful, please report it.)

11/27/2008 9:19:59 AMReydan Gatchalian

Hey. I love your article. Can I just ask will the principle be the same if your are using a usercontrol? Can you please e-mail me for the answer? I was planning to create a control with multiple buttons but I need to detect which of the buttons has been clicked.
(If this comment was disrespectful, please report it.)

3/18/2011 11:51:10 AMJohn Cunningham

Excellent - Thank You Ramon
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.