Is it possible to drag a line control at runtime?
Hi,
Is it possible to drag a line control at runtime similar to picturebox or image? If it is possible then what can be an appropriate strategy? As far as I know, Line control does not have any intrinsic Mouse events in it (Mouse Down/Move/Up etc.) Is it possible to simulate the mouse events with user defined functions in order to implement the drag and drop a Line Control?
Re: Is it possible to drag a line control at runtime?
Yeah, by not using a Line Control at all. You oughta try drawing a line on the UserForm, and using the forms mouse events for that. Of course you are gonna need a Timer or a loop to clear the window, draw, and repeat. ;)
Re: Is it possible to drag a line control at runtime?
How about placing a picture of the line in a Image Control, setting its BoarderStyle to none, and using the Image Controls Events.
Re: Is it possible to drag a line control at runtime?
You can use a label resized to the height of the line thickness you want then size the width to the length you need. Set its backcolor your desired color. Using the Label control to replicate a line will give you the mouse events you need to move it around.