Label's Mouseup not working

  • Thread starter Thread starter SwatSoftwareDev
  • Start date Start date
S

SwatSoftwareDev

Hi,

In my application I have placed some labels on a picturebox in a
usercontrol. And I have kept this UC on a form. I want to handle label's
mouse up event in UC, but I am unable to do so.When I insert a break point
on label's mouseup event handler, and click on this label (when application
is running), the control doesn't go to handler. Although label's mouse down
event handler is working properly. What might be the reason of this problem
? Can anyone help me ?

Thanks in advance,

Reg,
Swat
 
SwatSoftwareDev,

Is the event get fired if the label and Picturebox are not part of a user
control, but rather placed directly on the form?

Make sure that the event is actually hooked. Open the designer and look at
the events tab for the label. Do you see the name of your handler method
there?
 
Hi Stoitcho,

As you asked I had tried earlier placing label directly on form, and it is
working. I have also placed it in a picturebox in a form, and that too is
working.
I want to ask one more question. Where is the event tab that you told to
view me ("Open the designer and look at the events tab for the label" ). As
I never tried that.

Reg,
Swat
 
Hi,

The event tab I was refering to is on the Property Grid. If you use a C#
when you select a control or component on the design surface the Property
Grid shows you selected object's properties. On the property grid there is a
button with a lighting on it. Click this button and you'll see all the
events that the control or component exposes. If an event is handled you
have to see the name of the method that handles the event. This work only in
the case if you have handled event using the designer. If the event is
hooked on from code you won't see anything there. My idea was that some
times the event might get unhooked, you can see the method in the code, but
it is not attached to the event.

In VB there is no event tab in the property borwser and the hooking is done
via combobox in the editor. I'm not very familiar with VB IDE, so I can't
give you advice there.

Keep in mind that the PictureBox is not a container control. Even if you
place the label over the PictureBox the real host (parent) is the form,
control, panel, or something else that is a container control.
 
Back
Top