怎么将菜单中的各项添加到listbox中?

解决方案 »

  1.   

    for i := 0 to MainMenu1.Items.Count - 1 do
    begin 
      ListBox1.Items.Add(MainMenu1.Items[i].Caption);
    end;
      

  2.   

    ListBox不好,TreeView应该比较好。
      

  3.   

    function islbexist(addstr:string;lb:TListBox):boolean;
    var
      i:integer;
    begin
      if lb.Items.Count > 0 then
         begin
           for i:=0 to lb.Items.Count - 1 do
             begin
                if addstr = trim(lb.Items.Strings[i]) then
                   begin
                      result := true;
                      exit;
                   end
                else
                   result:=false;
             end;
         end;
    end;
      

  4.   

    zmy9709(温柔一刀) 说的好用treeview会 比较直观