281264 Messages: 270 Registered: June 2010 Location: Spain
Experienced Member
Hi,
Which Ctrl function is invoked when and during the left button of the mouse is pressed? I have had a look on LeftDrag and LeftHold; are one of these suitable for what I want?
Which Ctrl function is invoked when and during the left button of the mouse is pressed? I have had a look on LeftDrag and LeftHold; are one of these suitable for what I want?
mrjt Messages: 705 Registered: March 2007 Location: London
Contributor
The code you want is something like:
void LeftDown(Point p, dword keyflags)
{
SetCapture();
// All mouse events are now directed to this ctrl until ReleaseCapture is called
}
void MouseMovePoint p, dword keyflags)
{
if (HasCapture())
// Left mouse is depressed
else
// No button pressed
}
void LeftDown(Point p, dword keyflags)
{
ReleaseCapture();
}
There are loads of other ways of doing it, but this is the cleanest for simple behaviour. You can also use LeftHold/LeftDrag but they have a slight delay before being triggered.