Re: Mouse Capture

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Is it possible to keep the mouse 'captured' after the MouseUp event?
This doesn't seem to work:
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
this.Capture = true;
}

Trace output in my OnMouseMove handler shows that the mouse isn't captured
outside the window...
Thanks for any help.


"Bob Powell [MVP]" wrote:

> Just use Control.Capture true or false...
>
> To capture the mouse within your own derived control call this.Capture=true.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing

.



Relevant Pages

  • Re: Problem with SetCapture
    ... protected override void OnMouseMove ... It appears no matter what I do in OnMouseDown/OnMouseUp, ... >>> By default I would guess that the MouseUp will be releasing any capture ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Forwarders seem to fail...please help
    ... >> I would break out NetMon on server01.variantresearch.com and capture ... >> William Stacey, MVP ... >>> I have DNS opened up on the firewall so you can query that DNS server ...
    (microsoft.public.win2000.dns)
  • Re: Forwarders seem to fail...please help
    ... >> I would break out NetMon on server01.variantresearch.com and capture ... >> William Stacey, MVP ... >>> I have DNS opened up on the firewall so you can query that DNS server ...
    (microsoft.public.win2000.dns)
  • Re: How to completely prevent captured mouse from getting grabbed by others?
    ... usually between one mousedown and the next mouseup event. ... If you're trying to capture for longer than this then you're probably doing ... Find great Windows Forms articles in Windows Forms Tips and Trickshttp://www.bobpowell.net/tipstricks.htm ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Replacing a CMultiDocTemplate with a (modified) CDialog
    ... Replace on OnOKand OnCancelhandlers of the dialogs with functions with empty bodies. ... Windows is behaving as it is supposed to, ... See my essay on building dialog-based apps on my MVP Tips site. ... I could capture ...
    (microsoft.public.vc.mfc)