unit InputUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TInputForm = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    BtnClear: TButton;
    BtnShow: TButton;
    BtnExit: TButton;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Label6: TLabel;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    RadioButton1: TRadioButton;
    Label7: TLabel;
    RadioButton2: TRadioButton;
    Label8: TLabel;
    ListBox1: TListBox;
    procedure FormCreate(Sender: TObject);
    procedure BtnClearClick(Sender: TObject);
    procedure BtnShowClick(Sender: TObject);
    procedure BtnExitClick(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure ComboBox2Change(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  InputForm: TInputForm;

implementation
  uses InfoUnit;
{$R *.dfm}

procedure TInputForm.FormCreate(Sender: TObject);
begin  //输入如下6行代码
  ListBox1.Items.Add('山西');   //使用Add方法向列表框增加项目
  ListBox1.Items.Add('北京');
  ListBox1.Items.Add('河北');
  ListBox1.Items.Add('河南');
  ListBox1.Items.Add('湖南');
  ListBox1.Items.Add('内蒙古');
end;

(*"清除"按钮事件处理代码*)
procedure TInputForm.BtnClearClick(Sender: TObject);
begin
(*清空各文本框*)
  Edit1.Text:= '';
  Edit2.Text:= '';
end;

(*"显示"按钮事件处理代码*)
procedure TInputForm.BtnShowClick(Sender: TObject);
begin
  InfoForm.ShowModal;
end;

(*"退出"按钮事件处理代码*)
procedure TInputForm.BtnExitClick(Sender: TObject);
begin
  InputForm.Close;  //关闭InputForm窗体
end;

(*组合框ComboBox1中选中的文本选项*)
procedure TInputForm.ComboBox1Change(Sender: TObject);
begin
  ComboBox1.Text:=ComboBox1.items[ComboBox1.ItemIndex];
end;

(*组合框ComboBox2中选中的文本选项*)
procedure TInputForm.ComboBox2Change(Sender: TObject);
begin
  ComboBox2.Text:=ComboBox2.items[ComboBox2.ItemIndex];
end;

(*选择性别*)
procedure TInputForm.RadioButton1Click(Sender: TObject);
begin
  RadioButton1.Checked:=true;
end;

procedure TInputForm.RadioButton2Click(Sender: TObject);
begin
RadioButton2.Checked:=true;
end;
end.
