Freigeben über


InkOverlay.Handle Property

Gets or sets the handle of the window to which the InkOverlay object is attached.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Property Handle As IntPtr
'Usage
Dim instance As InkOverlay
Dim value As IntPtr

value = instance.Handle

instance.Handle = value
public IntPtr Handle { get; set; }
public:
property IntPtr Handle {
    IntPtr get ();
    void set (IntPtr value);
}
/** @property */
public IntPtr get_Handle ()

/** @property */
public void set_Handle (IntPtr value)
public function get Handle () : IntPtr

public function set Handle (value : IntPtr)
Not applicable.

Property Value

The handle of the window to which the InkOverlay object is attached.

Value

Meaning

a null reference (Nothing in Visual Basic)

The InkOverlay object is not attached to a window.

System.Windows.Forms.ControlSystem.Windows.Forms.Control

The handle of the window to which the InkOverlay object is attached.

Remarks

The AttachedControl or Handle property must be set before the InkOverlay object can be enabled.

If the InkOverlay object is attached to a control, setting this property attaches the InkOverlay object to a window and clears the AttachedControl property.

Note

The InkOverlay must be disabled before setting this property. To disable the InkOverlay, set the Enabled property to false. You can then set this property and re-enable the object by setting the Enabled property to true.

If you use the AttachedControl property and the Handle property in your application, you will get a security exception when you run the application in the Internet zone. This is because the Handle property is not valid in the partial trust environment of the Internet zone, so the Tablet PC operating system reverts to the AttachedControl property.

Security noteSecurity Note:

If using under partial trust, this property requires SecurityPermissionFlag.UnmanagedCodeSecurityPermissionFlag.UnmanagedCode permission in addition to the permissions required by InkOverlay. See Security And Trust for more information.

Example

This C# example is a method that redirects an InkOverlay, theInkOverlay, to collect ink on a new control.

private void SwitchOverlay(Control collectingControl)
{
     theInkOverlay.Enabled = false;
     theInkOverlay.Handle = collectingControl.Handle;
     theInkOverlay.Enabled = true;
}

This Microsoft Visual Basic .NET example is a subroutine that redirects an InkOverlay, theInkOverlay, to collect ink on a new control.

Private Sub SwitchOverlay(ByVal collectingControl As Control)
    theInkOverlay.Enabled = False
    theInkOverlay.Handle = collectingControl.Handle
    theInkOverlay.Enabled = True
End Sub

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkOverlay Class
InkOverlay Members
Microsoft.Ink Namespace
InkOverlay.Enabled
InkOverlay.AttachedControl