📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Label3: TLabel;
Memo1: TMemo;
ComboBox1: TComboBox;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(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中
Memo1.Lines.Add(ComboBox1.Text);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox1.Items.Add('亚洲');
ListBox1.Items.Add('非洲');
ListBox1.Items.Add('欧洲');
ListBox1.Items.Add('北美洲');
ListBox1.Items.Add('南美洲');
ListBox1.Items.Add('大洋洲');
ListBox1.Items.Add('南极洲');
ComboBox1.SelText
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -