H
hurryman
Unregistered / Unconfirmed
GUEST, unregistred user!
//
//i want insert all menu item to treeview from mainmenu
//but i can't ,this is my code .please help me .
procedure TForm1.Button1Click(Sender: TObject);
var i,j,k:integer ;
begin
for i:=0 to (mainmenu1.Items.Count-1) do
begin
k:=-1 ;
treeview1.Items.Add(nil,mainmenu1.Items.Caption) ;
for j:=0 to mainmenu1.Items.Count-1 do
begin
treeview1.Items.AddChild(treeview1.Items,mainmenu1.Items.Items[j].Caption );
k:=k+1;
if k=(mainmenu1.Items.Count-1) then
break
else
continue ;
end;
// break ;
end;
end;
//i want insert all menu item to treeview from mainmenu
//but i can't ,this is my code .please help me .
procedure TForm1.Button1Click(Sender: TObject);
var i,j,k:integer ;
begin
for i:=0 to (mainmenu1.Items.Count-1) do
begin
k:=-1 ;
treeview1.Items.Add(nil,mainmenu1.Items.Caption) ;
for j:=0 to mainmenu1.Items.Count-1 do
begin
treeview1.Items.AddChild(treeview1.Items,mainmenu1.Items.Items[j].Caption );
k:=k+1;
if k=(mainmenu1.Items.Count-1) then
break
else
continue ;
end;
// break ;
end;
end;