PenInputPanel.Visible 屬性
已取代。取得或設定一個值,指出 PenInputPanel 物件是否可見。PenInputPanel 已被 Microsoft.Ink.TextInput 取代。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Property Visible As Boolean
'用途
Dim instance As PenInputPanel
Dim value As Boolean
value = instance.Visible
instance.Visible = value
public bool Visible { get; set; }
public:
property bool Visible {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_Visible()
/** @property */
public void set_Visible(boolean value)
public function get Visible () : boolean
public function set Visible (value : boolean)
屬性值
型別:System.Boolean
如果可以看見畫筆輸入面板,則為 true,否則為 false。
備註
您只能在附加的控制項擁有焦點時,將 Visible 屬性設為 true。否則,設定這個屬性會產生錯誤。
![]() |
---|
如果在部分信任的情況下使用,除了 PenInputPanel 所需的權限之外,這個屬性還需要 SecurityPermissionFlag.AllFlags (英文) 權限。如需詳細資訊,請參閱Security and Trust。 |
範例
這個 C# 範例會建立 PenInputPanel 物件 thePenInputPanel,並且將它附加至 InkEdit 控制項 theInkEdit。接著會附加名為 VisibleChanged_Event 的 VisibleChanged 事件處理常式。如果 Visible 屬性設為 true,則事件處理常式會將句子加入至 theInkEdit 的內容。
[C#]
//...
// Delcare the PenInputPanel object
PenInputPanel thePenInputPanel;
public Form1()
{
// Required for Windows Form Designer support
InitializeComponent();
// Create and attach the new PenInputPanel to an InkEdit control.
thePenInputPanel = new PenInputPanel(theInkEdit);
// Add a VisibleChanged event handler
thePenInputPanel.VisibleChanged +=
new PenInputPanelVisibleChangedEventHandler(VisibleChanged_Event);
}
//...
public void VisibleChanged_Event(object sender,
PenInputPanelVisibleChangedEventArgs e)
{
// Make sure the object that generated
// the event is a PenInputPanel object
if (sender is PenInputPanel)
{
PenInputPanel theSenderPanel = (PenInputPanel)sender;
// When the panel has become visible...
if (theSenderPanel.Visible)
{
// Display a message in the attached edit control
theSenderPanel.AttachedEditControl.Text += "The panel is visible." + Environment.NewLine;
}
}
}
這個 Microsoft® Visual Basic® .NET 範例會建立 PenInputPanel 物件 thePenInputPanel,並且將它附加至 InkEdit 控制項 theInkEdit。接著會附加名為 VisibleChanged_Event 的 VisibleChanged 事件處理常式。如果 Visible 屬性設為 true,則事件處理常式會將句子加入至 theInkEdit 的內容。
[Visual Basic]
'...
' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel
Public Sub New()
MyBase.New()
' Required for Windows Form Designer support
InitializeComponent()
' Create and attach the new PenInputPanel to an InkEdit control.
thePenInputPanel = New PenInputPanel(theInkEdit)
' Add a VisibleChanged event handler
AddHandler thePenInputPanel.VisibleChanged, _
AddressOf VisibleChanged_Event
End Sub 'New
'...
Public Sub VisibleChanged_Event(sender As Object, e As _
PenInputPanelVisibleChangedEventArgs)
' Make sure the object that generated
' the event is a PenInputPanel object
If TypeOf sender Is PenInputPanel Then
Dim theSenderPanel As PenInputPanel = CType(sender, PenInputPanel)
' When the panel has become visible...
If theSenderPanel.Visible Then
' Display a message in the attached edit control
theSenderPanel.AttachedEditControl.Text &= _
"The panel is visible." & Environment.NewLine
End If
End If
End Sub 'VisibleChanged_Event
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0