L lunyx_allen Unregistered / Unconfirmed GUEST, unregistred user! 2007-11-26 #1 怎样动态改变toolbar里面的button的位置?比如:toolbar里面有两个button,buton1,button2.我现在想把两个的位置调换一下,如何操作啊。请高手们写出代码啊
J jieking Unregistered / Unconfirmed GUEST, unregistred user! 2007-11-26 #2 你可以把所有的BUTTON的位置都记录下来存数据库或INI文件,软件启动的时候调入设置值 也就是TOP ,LIFT 值变变就可以了
A ANiDelphi Unregistered / Unconfirmed GUEST, unregistred user! 2007-11-26 #3 直接设置Left就行了 procedure ChangeButton(Btn1, Btn2: TToolButton); var I: Integer; begin I := Btn1.Left; Btn1.Left := Btn2.Left; Btn2.Left := I; end; procedure TForm1.Button1Click(Sender: TObject); begin ChangeButton(ToolButton1, ToolButton2); end;
直接设置Left就行了 procedure ChangeButton(Btn1, Btn2: TToolButton); var I: Integer; begin I := Btn1.Left; Btn1.Left := Btn2.Left; Btn2.Left := I; end; procedure TForm1.Button1Click(Sender: TObject); begin ChangeButton(ToolButton1, ToolButton2); end;
L lunyx_allen Unregistered / Unconfirmed GUEST, unregistred user! 2007-12-03 #4 直接设为left怎么行?要是几个button的宽度不一样,那就不准了