?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Memo1: TMemo;
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
procedure ListBox1Enter(Sender: TObject);
procedure ListBox1Exit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Add(Edit1.Text); //添加國名到Tmemo中
If ListBox1.ItemIndex>=0 //用戶在ListBox中已作選擇
Then Memo1.Lines.Add(ListBox1.Items[ListBox1.ItemIndex]) //添加大洲名到Memo中
end;
procedure TForm1.ListBox1Enter(Sender: TObject);
begin
ListBox1.Color:=ClSkyBlue;
end;
procedure TForm1.ListBox1Exit(Sender: TObject);
begin
ListBox1.Color:=ClWindow;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -