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_MouseEnter" 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_ButtonClick(ByVal sender as Object, ByVal e as
ToolBarButtonClickEventArgs) Handles Toolbar1.ButtonClick
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("ButtonClick")
ei.AddEventHandler(ToolBar1, New ToolBarButtonClickEventHandler(AddressOf
ToolBar1_ButtonClick))
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.microsoft.com> wrote in message
news:$L**************@TK2MSFTNGXA02.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