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.
// 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.
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:
Re-scan downloaded files using your personal virus checker before using it.
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...
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.
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.
You may link to this code from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
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.)
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.)
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.)