C# 클래스 NanoByte.Common.Native.WinFormsUtils

Provides helper methods and API calls specific to the System.Windows.Forms UI toolkit.
파일 보기 프로젝트 열기: nano-byte/common

공개 메소드들

메소드 설명
CenterOnParent ( [ form ) : void

Centers a window on its parent/owner. Call this from the Form.Load event handler.

This method is an alternative to FormStartPosition.CenterParent which only works with Form.ShowDialog(IWin32Window) and not Form.Show(IWin32Window).

IsKeyDown ( Keys key ) : bool

Determines whether key is pressed right now.

Will always return false on non-Windows OSes.

RegisterTouchWindow ( Control control ) : void

Registers a control as a receiver for touch events.

ReleaseCapture ( ) : bool

Releases the mouse cursor after it was locked by SetCapture.

Will always return false on non-Windows OSes.

SetCapture ( IntPtr handle ) : IntPtr

Prevents the mouse cursor from leaving a specific window.

Will do nothing on non-Windows OSes.

비공개 메소드들

메소드 설명
AddShieldIcon ( [ button ) : void
EnableWindowDrag ( [ control ) : void
HandleTouchMessage ( Message &m, object sender, EventHandler onTouchDown, EventHandler onTouchMove, EventHandler onTouchUp ) : void
SetForegroundWindow ( [ form ) : void

메소드 상세

CenterOnParent() 공개 정적인 메소드

Centers a window on its parent/owner. Call this from the Form.Load event handler.
This method is an alternative to FormStartPosition.CenterParent which only works with Form.ShowDialog(IWin32Window) and not Form.Show(IWin32Window).
public static CenterOnParent ( [ form ) : void
form [
리턴 void

IsKeyDown() 공개 정적인 메소드

Determines whether key is pressed right now.
Will always return false on non-Windows OSes.
public static IsKeyDown ( Keys key ) : bool
key Keys
리턴 bool

RegisterTouchWindow() 공개 정적인 메소드

Registers a control as a receiver for touch events.
public static RegisterTouchWindow ( Control control ) : void
control System.Windows.Forms.Control The control to register.
리턴 void

ReleaseCapture() 공개 정적인 메소드

Releases the mouse cursor after it was locked by SetCapture.
Will always return false on non-Windows OSes.
public static ReleaseCapture ( ) : bool
리턴 bool

SetCapture() 공개 정적인 메소드

Prevents the mouse cursor from leaving a specific window.
Will do nothing on non-Windows OSes.
public static SetCapture ( IntPtr handle ) : IntPtr
handle System.IntPtr The handle to the window to lock the mouse cursor into.
리턴 System.IntPtr