取得或設定附加 InkCollector 物件之視窗的控制代碼。
命名空間: 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
所附加 InkCollector 物件之視窗的控制代碼。
值 |
意義 |
|---|---|
nullNull 參照 (即 Visual Basic 中的 Nothing) |
InkCollector 物件未附加至視窗 (如果 AttachedControl 同時也是 nullNull 參照 (即 Visual Basic 中的 Nothing))。 |
所附加 InkCollector 物件之視窗的控制代碼。 |
備註
必須設定 AttachedControl 或 Handle 屬性,才能啟用 InkCollector 物件。
如果 InkCollector 物件已附加至控制項,設定這個屬性就會將 InkCollector 物件附加至視窗,並清除 AttachedControl 屬性。
注意事項: |
|---|
必須停用 InkCollector,才能設定這個屬性。若要停用 InkCollector,請將 Enabled 屬性設為 false。然後,您就可以設定這個屬性,並透過將 Enabled 屬性設定為 true 來重新啟用物件。 |
如果您在應用程式中使用 AttachedControl 屬性和 Handle 屬性,則在 [網際網路] 區域執行應用程式時會收到安全性例外狀況。這是因為 Handle 屬性在 [網際網路] 區域的部分信任環境中無效,所以 Tablet PC 作業系統會還原成 AttachedControl 屬性。
安全性注意事項: |
|---|
如果在部分信任的情況下使用,除了 InkCollector 所需的權限之外,這個屬性還需要 SecurityPermissionFlag.UnmanagedCode 權限。如需詳細資訊,請參閱Security And Trust。 |
範例
下列範例所示範的方法,可用來指示 InkCollector 物件或 InkOverlay 物件來收集新控制項上的筆墨。
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
注意事項:
安全性注意事項: