Поделиться через


InkCollector.Handle - свойство

Обновлен: Ноябрь 2007

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

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Property Handle As IntPtr
'Применение
Dim instance As InkCollector
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)

Значение свойства

Тип: System.IntPtr
The handle of the window to which the InkCollector object is attached.

Value

Meaning

nullссылка null (Nothing в Visual Basic)

The InkCollector object is not attached to a window (if AttachedControl is also nullссылка null (Nothing в Visual Basic)).

System.Windows.Forms.Control.Handle

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

Заметки

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

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

ms571715.alert_note(ru-ru,VS.90).gifПримечание.

The InkCollector must be disabled before setting this property. To disable the InkCollector, 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.

ms571715.alert_security(ru-ru,VS.90).gifПримечание о безопасности.

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

Примеры

The following example shows a method that can be used to direct either an InkCollector object, or an InkOverlay object to collect ink on a new control.

Private Sub SwitchInkObjectHandle(ByVal collectingControl As Control)
    ' mInkObject can be InkCollector or InkOverlay
    mInkObject.Enabled = False
    ' setting the Handle property sets the AttachedControl property to null
    mInkObject.Handle = collectingControl.Handle
    mInkObject.Enabled = True
End Sub
private void SwitchInkObjectHandle(Control collectingControl)
{
    // mInkObject can be InkCollector or InkOverlay
    mInkObject.Enabled = false;
    // setting the Handle property sets the AttachedControl property to null
    mInkObject.Handle = collectingControl.Handle;
    mInkObject.Enabled = true;
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkCollector Класс

InkCollector - члены

Microsoft.Ink - пространство имен

InkCollector.InkCollector

InkCollector.Enabled

InkCollector.AttachedControl