风
风云再起
Unregistered / Unconfirmed
GUEST, unregistred user!
1:
procedure AddGroupItem(FTreeView: TTreeView; const FUserName: string);
var
MyTreeNode, MyTreeNodeChild: TTreeNode;
begin
MyTreeNode := nil;
with FTreeView.Items do
begin
MyTreeNode := Add(MyTreeNode, FUserName);
MyTreeNode.ImageIndex := 0;
MyTreeNodeChild := AddChild(MyTreeNode, '受件箱');
MyTreeNodeChild.ImageIndex := 1;
MyTreeNodeChild := AddChild(MyTreeNode, '发件箱');
MyTreeNodeChild.ImageIndex := 2;
MyTreeNodeChild := AddChild(MyTreeNode, '已发送邮件箱');
MyTreeNodeChild.ImageIndex := 3;
MyTreeNodeChild := AddChild(MyTreeNode, '废件箱');
MyTreeNodeChild.ImageIndex := 4;
end;
end;
这一段代码语法上没任何错误,但是,当你点击子结点时,他的图标跟父图标一样,为什么?
2:
procedure NextItem(FCurrentItem:TTreeNode);
var
FTreeNode:TTreeNode;
begin
if FCurrentItem.Parent=nil then//没有父结点了
FTreeNode:=FCurrentItem.getNextSibling;//得到同一层次的下一个结点
if FTreeNode<>nil then
FCurrent.MoveTo(FTreeNode,naInsert);
end;
编译通过,getNextSibling是得到同一层次上的下一个结点,但结果什么也没实现??
procedure AddGroupItem(FTreeView: TTreeView; const FUserName: string);
var
MyTreeNode, MyTreeNodeChild: TTreeNode;
begin
MyTreeNode := nil;
with FTreeView.Items do
begin
MyTreeNode := Add(MyTreeNode, FUserName);
MyTreeNode.ImageIndex := 0;
MyTreeNodeChild := AddChild(MyTreeNode, '受件箱');
MyTreeNodeChild.ImageIndex := 1;
MyTreeNodeChild := AddChild(MyTreeNode, '发件箱');
MyTreeNodeChild.ImageIndex := 2;
MyTreeNodeChild := AddChild(MyTreeNode, '已发送邮件箱');
MyTreeNodeChild.ImageIndex := 3;
MyTreeNodeChild := AddChild(MyTreeNode, '废件箱');
MyTreeNodeChild.ImageIndex := 4;
end;
end;
这一段代码语法上没任何错误,但是,当你点击子结点时,他的图标跟父图标一样,为什么?
2:
procedure NextItem(FCurrentItem:TTreeNode);
var
FTreeNode:TTreeNode;
begin
if FCurrentItem.Parent=nil then//没有父结点了
FTreeNode:=FCurrentItem.getNextSibling;//得到同一层次的下一个结点
if FTreeNode<>nil then
FCurrent.MoveTo(FTreeNode,naInsert);
end;
编译通过,getNextSibling是得到同一层次上的下一个结点,但结果什么也没实现??