p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual Basic 2005 Basics (http://p2p.wrox.com/forumdisplay.php?f=137)
-   -   Event Handling (http://p2p.wrox.com/showthread.php?t=71690)

Apocolypse2005 December 2nd, 2008 06:34 PM

Event Handling
 
I have made a new control which is a tab (just the tab) for use within another new control which is a tab browser. The link there, tab for a tab browser. Anyways, these tabs are added to the browser during runtime, so a global event handler is needed to handle a tab click from any one of these tabs, each one has a property called index which is set when the tab is added. So i think my question is what is the code for the event handler?

------------------------------------------------
Apocolypse2005, I'm a programmer - of sorts.

Apocolypse2005 March 10th, 2009 07:14 AM

The Answer
 
The answer i got for this thread is to use
Code:

Dim newButton AsNew Button

Public Sub load_newButton()
newButton.Text =
"Click Me"
newButton.Name = "btnClickMe"
AddHandler newButton.Click, AddressOf buttonClick
End Sub
 
Public Sub buttonClick(ByVal sender As Object, ByVal e As EventArgs)
'Code in here
End Sub



All times are GMT -4. The time now is 01:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.