[TUT] How to add dynamically add events. [N00B FRIENDLY]
Note: I will not use any code tags or include any text code, simply for the fact that you cannot C&P this. If you don't already know how to do this, you'll have to learn. I will use pictures from which you can READ and UNDERSTAND the code.
Alright, I wrote this simple tutorial because it's pretty easy and very helpful. Everyone should know how to do this.
Step 1.) Create a new project and give it a name-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/33564288-0247-435f-97a1-9b754ac5e4fe/2011-03-26_2319.png[/img]
Step 2.) Double click the form to bring up the Form_Load code-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/7e6db3c0-bc52-4fd1-9cd7-f5cff3378354/2011-03-26_2322.png[/img]
Step 3.) Study the code below and try it out-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/1f0e0542-aec7-4873-9ca0-f26dab695580/2011-03-26_2328.png[/img]
Step 4.) You're done! Try it out.
[img]http://content.screencast.com/users/codydv/folders/Jing/media/0adce992-600a-4f0d-bf86-9be304ff212c/2011-03-26_2329.png[/img]
Thanks for reading. And I know it's a pretty small tutorial but it's mainly for beginners.
EDIT: To remove a handle dynamically, you could simply use the RemoveHandler method.
Note: I will not use any code tags or include any text code, simply for the fact that you cannot C&P this. If you don't already know how to do this, you'll have to learn. I will use pictures from which you can READ and UNDERSTAND the code.
Alright, I wrote this simple tutorial because it's pretty easy and very helpful. Everyone should know how to do this.
Step 1.) Create a new project and give it a name-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/33564288-0247-435f-97a1-9b754ac5e4fe/2011-03-26_2319.png[/img]
Step 2.) Double click the form to bring up the Form_Load code-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/7e6db3c0-bc52-4fd1-9cd7-f5cff3378354/2011-03-26_2322.png[/img]
Step 3.) Study the code below and try it out-
[img]http://content.screencast.com/users/codydv/folders/Jing/media/1f0e0542-aec7-4873-9ca0-f26dab695580/2011-03-26_2328.png[/img]
Step 4.) You're done! Try it out.
[img]http://content.screencast.com/users/codydv/folders/Jing/media/0adce992-600a-4f0d-bf86-9be304ff212c/2011-03-26_2329.png[/img]
Thanks for reading. And I know it's a pretty small tutorial but it's mainly for beginners.
EDIT: To remove a handle dynamically, you could simply use the RemoveHandler method.
Code
RemoveHandler abutton.click, abutton_click

