Toolbar stops catching "Click" event after some time.

  • Thread starter Thread starter Sakharam Phapale
  • Start date Start date
S

Sakharam Phapale

Hi All,

I am working on a project, where maximum operations carried out on Files and
multi-dimensional arrays. Since array data is huge application takes too
much memory.

My problem is, after few operations, toolbar on MDI from doesn't catch
"Click" event.
But it catch all other events like mouse leave etc.

I am not been able to find out the reason.

Please help me by giving some thoughts.

Thanks in advance,

Sakharam Phapale
 
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
 
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
 
Back
Top