Hi Mohamed,
Actually my code is in VB.
I am using Toolbar in which there are few buttons (Cut, Copy, Paste, Delete,
etc..)
After starting the application click events works perfectly but after some
time click event doesn't get fired.
But still other event like "ToolBar1_Mouse Enter" works fine.
Since it is in VB you don't need to write code to add event handler like in
C#.
To acheive the same I need to add it in procedure itself.
Private Sub Toolbar1_Button Click(ByVal sender as Object, ByVal e as
ToolBarButtonCl ickEventArgs) Handles Toolbar1.Button Click
Above code gets generated at design time.
For run time I am using following alternate code
Dim ei As EventInfo
Dim myType As Type = GetType(ToolBar )
ei = myType.GetEvent ("ButtonClic k")
ei.AddEventHand ler(ToolBar1, New ToolBarButtonCl ickEventHandler (AddressOf
ToolBar1_Button Click))
I think it is related to event handler which gets remove automatically after
some time.
But I am not sure how to trace that.
Thanks and Regards,
Sakharam Phapale
"Mohamoss" <mo************ @egdsc.microsof t.com> wrote in message
news:$L******** ******@TK2MSFTN GXA02.phx.gbl.. .
hi Sasharam
Does it work initially or it doesn't catch the event at all. ( mostly you
tried debuging to see if the handler is called). would you post the event
handler you have
Mohamed Mahfouz