使用されていません。PenInputPanel オブジェクトの上端の垂直 (または y 軸) 位置を取得します。PenInputPanel は Microsoft.Ink.TextInput に置き換えられました。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public ReadOnly Property Top As Integer
'使用
Dim instance As PenInputPanel
Dim value As Integer
value = instance.Top
public int Top { get; }
public:
property int Top {
int get ();
}
/** @property */
public int get_Top()
public function get Top () : int
プロパティ値
型 : System.Int32
画面座標における PenInputPanel オブジェクトの上端の水平 (y 軸) 位置。
解説
PenInputPanel オブジェクトの自動配置動作を明示的にオーバーライドするには、オブジェクトの Left プロパティおよび Top プロパティを使用して、ペン入力パネルの現在の位置を調べます。
PanelMoving イベント時に PenInputPanelMovingEventArgs オブジェクトの Left プロパティおよび Top プロパティをリッスンすることにより、PenInputPanel オブジェクトの自動配置動作をオーバーライドすることもできます。
![]() |
---|
部分信頼で使用している場合、このプロパティには PenInputPanel により必要とされるアクセス許可に加えて、SecurityPermissionFlag.AllFlags アクセス許可が必要です。詳細については、「Security and Trust」を参照してください。 |
例
この C# の例では、PenInputPanel オブジェクト thePenInputPanel を作成し、それを InkEdit コントロール theInkEdit に結合します。次に、VisibleChanged イベント ハンドラ VisibleChanged_Event を結合します。イベント ハンドラは、Top プロパティを使用して、画面座標における PenInputPanel オブジェクトの上端の位置を示す theInkEdit のコンテンツに文を追加します。
[C#]
//...
// Declare 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 (e.NewVisibility)
{
// Display the top edge of the panel
// in the attached edit control
theSenderPanel.AttachedEditControl.Text +=
"The top edge of the panel is at ";
theSenderPanel.AttachedEditControl.Text += theSenderPanel.Top.ToString();
theSenderPanel.AttachedEditControl.Text += " pixels.\n";
}
}
}
この Microsoft® Visual Basic® .NET の例では、PenInputPanel オブジェクト thePenInputPanel を作成し、それを InkEdit コントロール theInkEdit に結合します。次に、VisibleChanged イベント ハンドラ VisibleChanged_Event を結合します。イベント ハンドラは、Top プロパティを使用して、画面座標における PenInputPanel オブジェクトの上端の位置を示す 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(ByVal sender As Object, ByVal 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 e.NewVisibility Then
' Display the top edge of the panel
' in the attached edit control
theSenderPanel.AttachedEditControl.Text += _
"The top edge of the panel is at "
theSenderPanel.AttachedEditControl.Text += _
theSenderPanel.Top.ToString()
theSenderPanel.AttachedEditControl.Text += _
" pixels." + ControlChars.Lf
End If
End If
End Sub 'VisibleChanged_Event
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0