HypernovaDesktop Components · docs
Binarymission
WinForms › Tree View Combo Box › TreeViewNative

TreeViewNative

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.ListControls

An out-of-the-box treeview control that implements the ISupportTreeView interface.

public class TreeViewNative : TreeView, ISupportTreeView

Inherits from / implements: TreeView, ISupportTreeView

Remarks

If your treeview control that you want to host in the drop-down window is a standard TreeView control, then you could use this class in the place the standard treeview control, and add nodes to this instance and set the TreeViewNativeInstance property with the instance of this class.
Please refer to TreeViewNativeInstance property for a sample on this.

Members at a glance

TreeViewNativeConstructs a new instance of TreeViewNative.
AccentColorGets or sets the colour of the selection and hover highlight in the modern style. Empty (the default) uses the system highlight colour.
IsModernAppearanceEnabledGets or sets whether the tree is drawn in its modern style: taller rows, a chevron expander with room around it, a rounded selection and hover highlight, and top-level nodes in bold. When false the tree draws as a standard Windows tree view.
DisposeReleases the resources held by this TreeViewNative.
OnAfterSelectRaises the AfterSelect event. TreeViewNative overrides it so the control's own handling runs alongside the base behavior.
OnDpiChangedAfterParentRecomputes the modern style's row height and indent for the new display scale.
OnDrawNodeDraws a node in the modern style: the row, the hover or selection highlight, the chevron expander and the text.
OnFontChangedRecomputes the modern style's row height for the new font.
OnHandleCreatedApplies the modern style's row height and indent once the window exists.
OnMouseLeaveClears the modern style's hover highlight.
OnMouseMoveTracks the node under the pointer for the modern style's hover highlight.
ToStringReturns a short description of this TreeViewNative, which is what the designer shows for the property.
AfterSelectRaises the required AfterSelect event, as prescribed in the ISupportTreeView interface.

Constructors

TreeViewNative

public TreeViewNative() : base()

Constructs a new instance of TreeViewNative.

Properties

AccentColor

public Color AccentColor

Gets or sets the colour of the selection and hover highlight in the modern style. Empty (the default) uses the system highlight colour.

IsModernAppearanceEnabled

public bool IsModernAppearanceEnabled

Gets or sets whether the tree is drawn in its modern style: taller rows, a chevron expander with room around it, a rounded selection and hover highlight, and top-level nodes in bold. When false the tree draws as a standard Windows tree view.

A tree with check boxes or an image list is always drawn by Windows.

Methods

Dispose

protected override void Dispose(bool disposing)

Releases the resources held by this TreeViewNative.

disposing
true when called from Dispose; false when called from the finalizer.

OnAfterSelect

protected override void OnAfterSelect(TreeViewEventArgs e)

Raises the AfterSelect event. TreeViewNative overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnDpiChangedAfterParent

protected override void OnDpiChangedAfterParent(EventArgs e)

Recomputes the modern style's row height and indent for the new display scale.

e
The data for the event.

OnDrawNode

protected override void OnDrawNode(DrawTreeNodeEventArgs e)

Draws a node in the modern style: the row, the hover or selection highlight, the chevron expander and the text.

e
The data for the event.

OnFontChanged

protected override void OnFontChanged(EventArgs e)

Recomputes the modern style's row height for the new font.

e
The data for the event.

OnHandleCreated

protected override void OnHandleCreated(EventArgs e)

Applies the modern style's row height and indent once the window exists.

e
The data for the event.

OnMouseLeave

protected override void OnMouseLeave(EventArgs e)

Clears the modern style's hover highlight.

e
The data for the event.

OnMouseMove

protected override void OnMouseMove(MouseEventArgs e)

Tracks the node under the pointer for the modern style's hover highlight.

e
The data for the event.

ToString

public override string ToString()

Returns a short description of this TreeViewNative, which is what the designer shows for the property.

Events

AfterSelect

public event ListControls.Shared.TreeViewEventHandler AfterSelect

Raises the required AfterSelect event, as prescribed in the ISupportTreeView interface.