Z
zhousi
Unregistered / Unconfirmed
GUEST, unregistred user!
点击treeview使当前节点ImageIndex从0变到1
结果点击后图象不发生变化,等我再次点击时,被选的节点图标不发生变化,前一次的图标
却变了
procedure Twjglmainf.FormShow(Sender: TObject);
var
Node:Ttreenode;
begin
Cds_jr_tree.Close;
Cds_jr_tree.CommandText:='select * from jr_tree where db_mang='''+'1'+'''';
Cds_jr_tree.Open;
while not Cds_jr_tree.Eof do
begin
Node:=TV_jr_tree.Items.Add(nil,Cds_jr_tree.FieldByName('fl_cname').AsString);
Node.ImageIndex:=0;
Cds_jr_tree.Next;
end;
//生成树
end;
procedure Twjglmainf.TV_jr_treeClick(Sender: TObject);
var
Node:Ttreenode;
begin
if TV_jr_tree.selected<>nil then
begin
node:=TV_jr_tree.Selected;
node.ImageIndex:=1;
end;
end;
结果点击后图象不发生变化,等我再次点击时,被选的节点图标不发生变化,前一次的图标
却变了
procedure Twjglmainf.FormShow(Sender: TObject);
var
Node:Ttreenode;
begin
Cds_jr_tree.Close;
Cds_jr_tree.CommandText:='select * from jr_tree where db_mang='''+'1'+'''';
Cds_jr_tree.Open;
while not Cds_jr_tree.Eof do
begin
Node:=TV_jr_tree.Items.Add(nil,Cds_jr_tree.FieldByName('fl_cname').AsString);
Node.ImageIndex:=0;
Cds_jr_tree.Next;
end;
//生成树
end;
procedure Twjglmainf.TV_jr_treeClick(Sender: TObject);
var
Node:Ttreenode;
begin
if TV_jr_tree.selected<>nil then
begin
node:=TV_jr_tree.Selected;
node.ImageIndex:=1;
end;
end;