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。否则,设置该属性将生成错误。

ms571984.alert_security(zh-cn,VS.90).gif安全说明:

如果在部分信任环境下使用,则除了 PenInputPanel 所需的权限以外,该属性还需要 SecurityPermissionFlag.AllFlags 权限。有关更多信息,请参见Security and Trust

示例

此 C# 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。然后,它附加 VisibleChanged 事件处理程序 VisibleChanged_Event。如果 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(R) Visual Basic(R) .NET 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。然后,它附加 VisibleChanged 事件处理程序 VisibleChanged_Event。如果 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

另请参见

参考

PenInputPanel 类

PenInputPanel 成员

Microsoft.Ink 命名空间

PenInputPanel.AutoShow