TreeNode.Index プロパティとは? わかりやすく解説

TreeNode.Index プロパティ

ツリー ノード コレクション内のツリー ノード位置取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

使用例使用例

TreeView.SelectedNode の Parent プロパティが表す TreeNode の Index プロパティText プロパティの値を表示するコード例次に示します。この例では、TreeView コントロール配置されForm存在している必要がありますTreeView コントロール2 つ上のルート ノード持ち、各ルート ノード1 つ上の子ノード持っている必要があります

Private Sub treeView1_AfterSelect(sender As
 Object, _
  e As TreeViewEventArgs) Handles treeView1.AfterSelect
   ' Display the Text and Index of the 
   ' selected tree node's Parent. 
   If (Not e.Node.Parent Is
 Nothing) 
      If (e.Node.Parent.GetType() Is GetType(TreeNode))
 Then
         statusBar1.Text = "Parent: " + e.Node.Parent.Text
 + _
           ControlChars.Cr + "Index Position: " +
 e.Node.Parent.Index.ToString()
      End If
   Else
      statusBar1.Text = "No parent node."
   End If
End Sub 
private void treeView1_AfterSelect(object sender,
 TreeViewEventArgs e)
{  
   /* Display the Text and Index of the 
    * selected tree node's Parent. */
   if(e.Node.Parent!= null && 
     e.Node.Parent.GetType() == typeof(TreeNode) )
   {
      statusBar1.Text = "Parent: " + e.Node.Parent.Text + "\n"
         + "Index Position: " + e.Node.Parent.Index.ToString();
   }
   else
   {
      statusBar1.Text = "No parent node.";
   }
}
private:
   void treeView1_AfterSelect( Object^ /*sender*/, TreeViewEventArgs^
 e )
   {
      /* Display the Text and Index of the
            * selected tree node's Parent. */
      if ( e->Node->Parent != nullptr && e->Node->Parent->GetType()
 == TreeNode::typeid )
      {
         statusBar1->Text = String::Format( "Parent: {0}\n Index Position:
 {1}", e->Node->Parent->Text, e->Node->Parent->Index );
      }
      else
      {
         statusBar1->Text = "No parent node.";
      }
   }
private void treeView1_AfterSelect(Object sender,
 TreeViewEventArgs e)
{
    /* Display the Text and Index of the 
       selected tree node's Parent. 
     */
    if (e.get_Node().get_Parent() != null &&
 e.get_Node().get_Parent().
        GetType().Equals(TreeNode.class.ToType())) {
        statusBar1.set_Text("Parent: " + e.get_Node().get_Parent().
            get_Text() + "\n" + "Index Position: " + System.Convert.
            ToString(e.get_Node().get_Parent().get_Index()));
    }
    else {
        statusBar1.set_Text("No parent node.");
    }
} //treeView1_AfterSelect
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からTreeNode.Index プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTreeNode.Index プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTreeNode.Index プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TreeNode.Index プロパティ」の関連用語

TreeNode.Index プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TreeNode.Index プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS