One HandleEvent Procedure/Hander can handle multiply control event handle. -create a simple handleE
One HandleEvent Procedure/Hander can handle multiply control event handle. -create a simple handleEvent procedure -using AddHandler
Rate One HandleEvent Procedure/Hander can handle multiply control event handle. -create a simple handleE
(1(1 Vote))
System.EventArgs)
'your common doubleclick handling code here
end sub
AddHandler textbox1.DoubleClick, AddressOf myDoubleClick
AddHandler textbox2.DoubleClick, AddressOf myDoubleClick
AddHandler textbox3.DoubleClick, AddressOf myDoubleClick
in the second method, you could loop through all your controls, check
whether its a textbox
and then use AddHandler.
something like...
for each oControl in Me.Controls()
if typeOf oControl is TextBox then
AddHandler oControl.DoubleClick, AddressOf myDoubleClick
end if
next oControl
======================================================
\\\
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
doset(Me)
End Sub
Private Sub doSet(ByVal parentCtr As Control)
Dim ctr As Control
For Each ctr In parentCtr.Controls
If TypeOf ctr Is Textbox then
AddHandler ctr.DoubleClick, AddressOf MyDoubleClick
end if
doSet(ctr)
Next
///
One HandleEvent Procedure/Hander can handle multiply control event handle. -create a simple handleE Comments
No comments yet — be the first to post one!
Post a Comment