unit ustudent;

interface

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

type
  Tstudentform = class(TForm)
    Label1: TLabel;
    studentno: TEdit;
    Label2: TLabel;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Label3: TLabel;
    name: TEdit;
    Label4: TLabel;
    specialityCom: TComboBox;
    ListBox1: TListBox;
    Label5: TLabel;
    OkBtn: TButton;
    ExitBtn: TButton;
    Label6: TLabel;
    Label7: TLabel;
    ChaRaBtn: TRadioButton;
    AddRaBtn: TRadioButton;
    RemoveRaBtn: TRadioButton;
    StudentMemo: TMemo;
    procedure OkBtnClick(Sender: TObject);
    procedure ExitBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  studentform: Tstudentform;

implementation

{$R *.dfm}

procedure Tstudentform.OkBtnClick(Sender: TObject);

var
     tmpstring,sex,r:string;
begin
   if radiobutton1.checked=true then
    sex:='男'
  else
    sex:='女';

  if AddRaBtn.checked then
      r:='新增信息'
  else if ChaRaBtn.checked then
      r:='信息修改'
  else if RemoveRaBtn.checked then
      r:='删除资料' ;
  StudentMemo.lines.Clear;
    tmpstring:='学号：'+StudentNo.Text;
  tmpstring:='       姓名：'+Name.Text+#13+#10;
  tmpstring:=tmpstring+'性别:'+sex;
  tmpstring:=tmpstring+'    专业：'+SpecialityCom.items[SpecialityCom.itemindex]+#13+#10;
  tmpstring:=tmpstring+'年级：'+ListBox1.items[ListBox1.itemindex]+#13+#10;
  tmpstring:=tmpstring+'操作类型为'+r;
studentmemo.Lines.Add(tmpstring);


end;

procedure Tstudentform.ExitBtnClick(Sender: TObject);
begin
close;
end;

end.
