当前位置:首页 >> 计算机软件及应用 >>

delphi TreeView详解

delphi TreeView 详解

property AutoExpand: Boolean; AutoExpand Set AutoExpand to true to cause the selected item to expand and the unselected items to collapse. property BorderStyle: TBorderStyleTBorderStyle; Set BorderStyle to specify whether the tree view control should be outlined with a single-line border. These are the possible values: BorderStyle Value bsNone bsSingle Meaning No visible border Single-line border

property Canvas: TCanvas; Canvas Use the Canvas property to paint to the canvas from the OnCustomDraw and OnCustomDrawItem event handlers. property ChangeDelay: Integer; Use ChangeDelay to get or set the delay, in milliseconds, ChangeDelay between when a node is selected and when the OnChange event occurs. Set the ChangeDelay to 50 milliseconds to emulate the behavior of the tree-view control used in Windows Explorer. property DropTarget: TTreeNode; Read DropTarget to determine whether a node in the tree view DropTarget is drawn as the target of a drag and drop operation. Set DropTarget when specifying a particular node in the tree view as the drop target of a dragged item. Note: When DropTarget is set, the application must still handle

delphi TreeView 详解

the actual logic of accepting the dragged object by the indicated node. property HideSelection: Boolean; Use HideSelection to specify whether the user is given visual HideSelection feedback about the current selection in the tree view when it does not have focus. If true, the selected node is not visually distinct from other nodes until focus returns to the control. If false, the node always appears selected. property HotTrack: Boolean; HotTrack Set HotTrack to true to provide visual feedback about which item is under the mouse. Set HotTrack to false to suppress the visual feedback about which item is under the mouse. property Images: TCustomImageList; Use Images to provide a customized list of bitmaps that can be displayed to the left of a node’s label. Individual nodes specify the image from this list that should appear by setting their ImageIndex property. property Indent: Integer; Indent Use Indent to determine how far child nodes are indented from their parent nodes when the parent is expanded. property Items: TTreeNodes; Individual nodes in a tree view are TTreeNode objects. These individual nodes can be accessed by using the Items property Items along with the item's index into the tree view. For example, to access the second item in the tree view, you could use the following code. MyTreeNode := TreeView1.Items[1]; When setting this property at design-time in the Object

Images

delphi TreeView 详解

Inspector the Tree View Items Editor appears. Use the New Item and New SubItem buttons to add items to the tree view. Use the Text property to modify what text is displayed in the label of the item. At run-time nodes can be added and inserted by using the TTreeNodes methods AddChildFirst, AddChild, AddChildObjectFirst, AddChildObject, AddFirst, Add, AddObjectFirst, AddObject, and Insert. Note: Accessing tree view items by index can be time-intensive, particularly when the tree view contains many items. For optimal performance, try to design your application so that it has as few dependencies on the tree view’s item index as possible. property MultiSelect: Boolean; MultiSelect Set MultiSelect to specify whether users can select multiple nodes using the Control and Shift keys. A selection style must also be chosen in MultiSelectStyle. type TMultiSelectStyles = (msControlSelect, msShiftSelect, msVisibleOnly, msSiblingOnly); TMultiSelectStyle = set of TMultiSelectStyles; MultiSelectStyle property MultiSelectStyle: TMultiSelectStyle; MultiSelectStyle determines how multiple selections are made when MultiSelect is true. MultiSelectStyle must include at least one of the following values. msControlSelect: Clicking on any node with the Control key pressed toggles the selection of that node.

delphi TreeView 详解

msShiftSelect: Clicking on any node with the Shift key press selects that node, the last single node selected, and the nodes in between. All other nodes are deselected. msVisibleOnly Multiple: selections with the Shift key do not include child nodes of collapsed nodes. msSiblingOnly: Selected nodes are restricted to a single set of siblings. If msControlSelect or msShiftSelect are in effect, the last singly-selected node becomes the primary selection, referenced by Selections[0]. The primary selection is the anchor for extended selections using the Shift key. property ReadOnly: Boolean; Use ReadOnly to specify whether the user can edit the nodes of the tree view. If ReadOnly is true, the user can expand and collapse nodes, but can’t edit their labels. If ReadOnly is false, the user can edit the labels as well. The default value is false. property RightClickSelect: Boolean; Use RightClickSelect to allow the Selected property to indicate nodes the user clicks with the right mouse button. If If RightClickSelect is true, the value of Selected is the value of the node last clicked with either the right or left mouse button. RightClickSelect clicked using the left mouse button. RightClickSelect affects only the value of the Selected property. It does not cause the tree view to highlight a new node if the node is selected using the right mouse button. Note: RightClickSelect must be set to true before the user RightClickSelect is false, the value of Selected is the node last

ReadOnly

delphi TreeView 详解

right-clicks the tree view for it to affect the value of the Selected property. property RowSelect: Boolean; Set RowSelect to true to cause the entire row of the selected item to be highlighted. RowSelect is ignored if ShowLines is true. property Selected: TTreeNode; Read Selected to access the selected node of the tree view. If there is no selected node, the value of Selected is nil (Delphi) or NULL (C++). Set Selected to set a node in the tree view. When a node becomes selected, the tree view's OnChanging and OnChange events occur. Also, if the specified node is the child of a collapsed parent item, the parent's list of child items is expanded to reveal the specified node. In this case, the tree Selected view's OnExpanded and OnExpanding events occur as well. If the RightClickSelect property is true, the value of Selected is the last node that was clicked in the tree view, even if it was clicked with the right mouse button. This may differ from the node that is highlighted to indicate selection. If the MultiSelect property is true and the MultiSelectStyle property includes msControlSelect, then Selected returns the last node clicked on, even if that click deselected the node. For a current selection status when MultiSelect is true, refer to the Selections property. property SelectionCount: Cardinal; SelectionCount SelectionCount returns the number of nodes currently selected.

RowSelect

delphi TreeView 详解

property Selections[Index: Integer]: TTreeNode; Selections returns one of selected nodes. The maximum value Selections of Index is SelectionCount-1. If more than one node is selected, Selections[0] is the primary selected node. This node is the starting point for extended selections if MultiSelectStyle includes msShiftSelect. property ShowButtons: Boolean; If ShowButtons is true, a button will appear to the left of each parent item. The user can click the button to expand or collapse the child items as an alternative to double-clicking the parent item. property ShowLines: Boolean; If ShowLines is true, lines linking child nodes to their parent nodes are displayed. Nodes at the root of the hierarchy are not automatically linked. To link nodes at the root, the ShowRoot property must also be set to true. property ShowRoot: Boolean; ShowRoot To show lines connecting top-level nodes to a single root, set the tree view's ShowRoot and ShowLines properties to true. property SortType: TSortType; Once a tree view is sorted, the original hierarchy is lost. That is, setting the SortType back to stNone will not restore the original order of items. These are the possible values: SortType stNone: No sorting is done. stData: The items are sorted when the Data object or SortType is changed. stText: The items are sorted when the Caption or SortType is

ShowButtons

ShowLines

delphi TreeView 详解

changed. stBoth: The items are sorted when either the Data object, the Caption or SortType is changed Optionally, the OnCompare event can be hooked to handle comparisons. property StateImages: TCustomImageList; StateImages Use StateImages to provide a set of bitmaps that reflect the state of tree view nodes. The state image appears as an additional image to the left of the item's icon. property ToolTips: Boolean; Set ToolTips to true to specify that items in the tree view ToolTips control have tool tips (Help Hints). Specify the ToolTip text in an OnHint event handler using the Hint property. property TopItem: TTreeNode; TopItem When TopItem is changed, the tree view scrolls vertically so that the specified node is topmost in the list view.


相关文章:
Delphi TreeView 基础与技巧(详解).txt
Delphi TreeView 基础与技巧(详解)_计算机软件及应用_IT/计算机_专业资料。条理介绍Delphi TreeView的基础知识,及应用技巧。 ?Delphi TreeView 基础与技巧(详解) ...
DELPHI中TREEVIEW的使用.pdf
DELPHITREEVIEW的使用 - delphiTreeview
delphi中TreeView控件使用.pdf
delphiTreeView控件使用 - DELPHI 中利用 TreeView 控件建立目录树 p>Rainbow 的话:关于 TreeView 的使用,还可以参看:联合使用 TreeVie...
DelPhi Treeview 操作实例.doc
DelPhi Treeview 操作实例 - DelPhi Treeview 操作实例 onclick 节点 treeview1.Selected.Level2011-08-31 15:58 怎...
DELPHI--TreeView与数据库的使用.doc
DELPHI--TreeView与数据库的使用 - [编程]DELPHI--TreeView 与数据库的使用 //写一个过程 procedure Tf_Serch.DrawTree; var i...
Treeview使用详解.doc
Treeview使用详解 - TreeView 由节点构成,建树通过对 TreeView.items 属性进行操作。Items 是一个 TTreeNodes 对象,这是一个 TTreeNode ...
[DELPHI]VIRTUALTREEVIEW使用说明.pdf
[DELPHI]VIRTUALTREEVIEW使用说明 - 单元格纵向位置及单元
VB控件 treeview用法详解.doc
VB控件 treeview用法详解 - VB TreeView 控件使用详解 (
VB控件 treeview用法详解_图文.pdf
VB控件 treeview用法详解_计算机软件及应用_IT/计算机_专业资料 暂无评价|0人阅读|0次下载 | 举报文档 VB控件 treeview用法详解_计算机软件及应用_IT/计算机_...
[Delphi]VirtualTreeview使用说明.doc
[Delphi]VirtualTreeview使用说明 - 单元格纵向位置及单元
VFP TreeView控件使用详解.doc
VFP TreeView控件使用详解 - VFP TreeView 控件使用详解(2) 工作帮手网(www.foxer.net),自 2001 年创办以来,一直坚持为在校学生、在 职职工服务的宗...
Delphi7中Treeview控件的应用_论文.pdf
Delphi7中Treeview控件的应用 - Treeview控件用于显示树型结构的数据,通常用来显示比较复杂的信息。本文介绍了delphi7中treeview树型控件的属性、节点对象的添加和...
三小时掌握TREEVIEW控件--access.doc
三小时掌握TREEVIEW控件--access - 三小时掌握 TREEVIEW 控件 TREEVIEW 控件在正常 ACCESS 数据库使用中是很频繁的,下面这篇文章与大家分享 一下: 一、详...
GtkTreeView 用法详解.doc
GtkTreeView 用法详解 - GtkTreeView 用法详解 GtkTreeView 用法详解(原) 2010 年 03 月 06 日 星期六 21:37 在 GTK+的所有构件(...
delphi树控件的用法.pdf
(Treeview)是 Win95 下新增加的通用显示部件(Common Control,在 COMCTL32.DLL 中)之一,从 Delphi2.0 开始也增加了相应的控件 Treeview ,用于取代原 Outline ...
TreeView控件使用教程.doc
VB控件 treeview用法详解... 暂无评价 7页 免费 TreeView控件功能应用代... ...Delphi TreeView 基础与... 4页 免费 使用TreeView控件实现树... 9页 免费...
VB Treeview控件的详细使用.doc
VB Treeview 控件的详细使用 VB Treeview 控件详细使用方法 1、属性 、这里只给大家介绍 Treeview 控件的几个常用基本属性 appearance 属性:设置空间是否以 3D ...
PB中TreeView控件使用技巧.doc
PB 中 TreeView 控件使用技巧 PB 中 TreeView 控件使用技巧 PB 中 TreeView ...delphiTreeView控件使... 17页 1下载券 喜欢此文档的还喜欢 PB...
基于Delphi的动态树型目录的设计与实现.pdf
4页 免费 TreeView详解 9页 免费 [Delphi]TreeView使
delphi常用组件的使用_图文.ppt
ListView组件和TreeView组件 ListBox列表类组件的使用 ListBox组件也称列表框,位于...delphi组件使用 3页 免费 喜欢此文档的还喜欢 delphi组件开发详解 48页 免费 ...
更多相关标签: