首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi树使用有关问题

2013-11-20 
delphi树使用问题使用了一个treeview控件,想点击树上结点的同时判断是否有子节点,然后根据结点的名称进行

delphi树使用问题
使用了一个treeview控件,想点击树上结点的同时判断是否有子节点,然后根据结点的名称进行不同的操作,功能是在Onclick函数里面写的,但是现在出现的问题是点击父节点前面的加号也会默认是点击了父节点,这个该怎么改呢?怎么能让点击那个加号的时候就是展开结点,点击子节点或者父节点的汉字的时候才执行操作?
[解决办法]
Returns information about the location of a point relative to the client area of the tree view control.

function GetHitTestInfoAt(X, Y: Integer): THitTests;


Description

THitTests is a set of THitTest values. THitTest can have any of the following values:

ValueMeans the point is

htAboveAbove the client area.
htBelowBelow the client area.
htNowhereInside the control, but not on an item.
htOnItemOn an item, its text, or its bitmap.
htOnButtonOn a button.
htOnIconOn an icon.
htOnIndentOn the indented area of an item.
htOnLabelOn a label.
htOnRightOn the right side of an item.
htOnStateIconOn a state icon or bitmap associated with an item.
htToLeftTo the left of the client area.
htToRightTo the right of the client area.

热点排行