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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > treeview.fullrowselect プロパティの意味・解説 

TreeView.FullRowSelect プロパティ

選択されている項目を強調表示するときに、ツリー ビュー コントロールの幅全体強調表示するかどうかを示す値を取得または設定します

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

Dim instance As TreeView
Dim value As Boolean

value = instance.FullRowSelect

instance.FullRowSelect = value
public bool FullRowSelect { get;
 set; }
public:
property bool FullRowSelect {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_FullRowSelect ()

/** @property */
public void set_FullRowSelect (boolean value)
public function get FullRowSelect
 () : boolean

public function set FullRowSelect
 (value : boolean)

プロパティ
選択されている項目を強調表示するときに、ツリー ビュー コントロールの幅全体強調表示する場合trueそれ以外場合false既定値false です。

解説解説

FullRowSelecttrue場合は、選択されているツリー ノード強調表示するときに、そのノードの幅ではなくツリー ビューの幅全体強調表示されます。ShowLines が true設定されている場合FullRowSelect プロパティ無視されます。

使用例使用例

カスタマイズされた TreeView のコード例次に示しますTreeView クラス継承することにより、このカスタム バージョンには通常の TreeView機能すべてが備わってます。ここでは、コンストラクタさまざまなプロパティ値を変更して固有の外観にします。ShowPlusMinus プロパティfalse設定されるため、このカスタム コントロールは、ノードクリックされたときに展開または折りたたみ可能になるように、OnAfterSelect メソッドオーバーライドます。

このようにしてカスタマイズしたコントロール階層全体使用できるため、一貫性のあるインターフェイス簡単に作成できるようになりますプロジェクトごとにコントロールさまざまなプロパティ指定する要はありません。

Public Class CustomizedTreeView
    Inherits TreeView

    Public Sub New()
        ' Customize the TreeView control by setting various properties.
        BackColor = System.Drawing.Color.CadetBlue
        FullRowSelect = True
        HotTracking = True
        Indent = 34
        ShowPlusMinus = False

        ' The ShowLines property must be false for the FullRowSelect
 
        ' property to work.
        ShowLines = False
    End Sub 'New


    Protected Overrides Sub
 OnAfterSelect(ByVal e As TreeViewEventArgs)
        ' Confirm that the user initiated the selection.
        ' This prevents the first node from expanding when it is
        ' automatically selected during the initialization of 
        ' the TreeView control.
        If e.Action <> TreeViewAction.Unknown Then
            If e.Node.IsExpanded Then
                e.Node.Collapse()
            Else
                e.Node.Expand()
            End If
        End If

        ' Remove the selection. This allows the same node to be
        ' clicked twice in succession to toggle the expansion state.
        SelectedNode = Nothing
    End Sub 'OnAfterSelect

End Class 'CustomizedTreeView
 
public class CustomizedTreeView : TreeView
{
    public CustomizedTreeView()
    {
        // Customize the TreeView control by setting various properties.
        BackColor = System.Drawing.Color.CadetBlue;
        FullRowSelect = true;
        HotTracking = true;
        Indent = 34;
        ShowPlusMinus = false;

        // The ShowLines property must be false for the FullRowSelect
 
        // property to work.
        ShowLines = false;
    }

    protected override void OnAfterSelect(TreeViewEventArgs
 e)
    {
        // Confirm that the user initiated the selection.
        // This prevents the first node from expanding when it is
        // automatically selected during the initialization of 
        // the TreeView control.
        if (e.Action != TreeViewAction.Unknown)
        {
            if (e.Node.IsExpanded) 
            {
                e.Node.Collapse();
            }
            else 
            {
                e.Node.Expand();
            }
        }

        // Remove the selection. This allows the same node to be
        // clicked twice in succession to toggle the expansion state.
        SelectedNode = null;
    }

}
public ref class CustomizedTreeView: public
 TreeView
{
public:
   CustomizedTreeView()
   {

      // Customize the TreeView control by setting various properties.
      BackColor = System::Drawing::Color::CadetBlue;
      FullRowSelect = true;
      HotTracking = true;
      Indent = 34;
      ShowPlusMinus = false;

      // The ShowLines property must be false for the FullRowSelect
      // property to work.
      ShowLines = false;
   }

protected:
   virtual void OnAfterSelect( TreeViewEventArgs^ e ) override
   {
      // Confirm that the user initiated the selection.
      // This prevents the first node from expanding when it is
      // automatically selected during the initialization of
      // the TreeView control.
      if ( e->Action != TreeViewAction::Unknown )
      {
         if ( e->Node->IsExpanded )
         {
            e->Node->Collapse();
         }
         else
         {
            e->Node->Expand();
         }
      }

      
      // Remove the selection. This allows the same node to be
      // clicked twice in succession to toggle the expansion state.
      SelectedNode = nullptr;
   }
};
public class CustomizedTreeView extends TreeView
{
    public CustomizedTreeView()
    {
        // Customize the TreeView control by setting various properties.
        set_BackColor(System.Drawing.Color.get_CadetBlue());
        set_FullRowSelect(true);
        set_HotTracking(true);
        set_Indent(34);
        set_ShowPlusMinus(false);
        // The ShowLines property must be false for the FullRowSelect
 
        // property to work.
        set_ShowLines(false);
    } //CustomizedTreeView

    protected void OnAfterSelect(TreeViewEventArgs
 e)
    {
        // Confirm that the user initiated the selection.
        // This prevents the first node from expanding when it is
        // automatically selected during the initialization of 
        // the TreeView control.
        if (!(e.get_Action().Equals(TreeViewAction.Unknown)))
 {
            if (e.get_Node().get_IsExpanded()) {
                e.get_Node().Collapse();
            }
            else {
                e.get_Node().Expand();
            }
        }
        // Remove the selection. This allows the same node to be
        // clicked twice in succession to toggle the expansion state.
        set_SelectedNode(null);
    } //OnAfterSelect
}//CustomizedTreeView 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS