📄 unit1.~pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
procedure Button5Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Function ListMoveF(Var l1,l2:Integer):WordBool;Export;
implementation
{$R *.dfm}
procedure TForm1.Button5Click(Sender: TObject);
begin
modalResult:=mrOk ;
end;
procedure TForm1.Button1Click(Sender: TObject);
Var
i:integer;
begin
For i:=ListBox1.Items.Count-1 Downto 0 do
If Listbox1.Selected[i] then
begin
Listbox2.Items.Add(ListBox1.Items.Strings[i]) ;
ListBox1.Items.delete(i);
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
Var
i:integer;
begin
For i:=ListBox2.Items.Count-1 Downto 0 do
If Listbox2.Selected[i] then
begin
Listbox1.Items.Add(ListBox2.Items.Strings[i]) ;
ListBox2.Items.delete(i);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ListBox2.Items.AddStrings(ListBox1.Items) ;
ListBox1.Clear ;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
ListBox1.Items.AddStrings(ListBox2.Items) ;
ListBox2.Clear ;
end;
Function ListMoveF(Var l1,l2:integer):WordBool;
begin
Result:=False;
Form1:=TForm1.Create(Application);
Try
if Form1.ShowModal =mrOK then
with form1 do
begin
l1:=ListBox1.Items.Count ;
l2:=ListBox2.Items.Count ;
Result:=True;
End;
Finally
Form1.Free;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
ModalResult:=mrCancel;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -