Event handling of a user control

C

coderjoe

I'm new to VB.Net and I'm using the 2003 version.

I created a user control that has two labels on it. The two labels are
side by side. The first is bold font and will be used to display a
line number. The second will show the text of the line.

These labels completely cover the control. I am adding the user
control to a form at runtime in a control array. I want the user to be
able to drag them to different positions on the form during runtime,
but the mousedown, mousemove, and mouseup events of the form are not
triggered because the labels cover the user control and therefore, the
labels receive the events.

How do I pass these mouse events to the user control so I can handle
the event from the form the control is placed on?
 
H

Herfried K. Wagner [MVP]

I created a user control that has two labels on it. The two labels are
side by side. The first is bold font and will be used to display a
line number. The second will show the text of the line.

These labels completely cover the control. I am adding the user
control to a form at runtime in a control array. I want the user to be
able to drag them to different positions on the form during runtime,
but the mousedown, mousemove, and mouseup events of the form are not
triggered because the labels cover the user control and therefore, the
labels receive the events.

<URL:http://dotnet.mvps.org/dotnet/samples/misc/XmlSerialization.zip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top