I tried this out, both Labels have their clicks serviced until button one is
pressed, then only label2 works.
\\
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click
MessageBox.Show("Label1.Clicked")
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label2.Click
MessageBox.Show("Label2.Clicked")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
RemoveHandler Label1.Click, AddressOf Label1_Click
End Sub
//
Regards - OHM
"VJ" <vi********@yahoo.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
Here is snippet of my problem
IF Condition1 then
RemoveHandler lblCntrl.Click, AddressOf lbl_ShowItem
AddHandler lblCntrl.Click, AddressOf lbl_ShowMaker2
elseif Condition2 then
AddHandler lblCntrl.Click, AddressOf lbl_ShowItem
RemoveHandler lblCntrl.Click, AddressOf lbl_ShowMaker2
end if
After the above block is executed I try to click on the label.. I have
both the "lbl_ShowItem" and "lbl_ShowMaker2" methods executed. I had to go
include the same IF check inside each method to prevent... Why is the
Remove Handler not removing the old method and adding a new one for the same
click event. Anybody have ideas??
Thanks
VJ