📄 unit2.pas
字号:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
Label12: TLabel;
Panel1: TPanel;
Label11: TLabel;
Panel2: TPanel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Main;
{$R *.dfm}
procedure TForm2.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if ((Form2.Edit1.Text='') and (Form2.Edit2.Text<>'')) or
((Form2.Edit2.Text='') and (Form2.Edit3.Text<>'')) or
((Form2.Edit3.Text='') and (Form2.Edit4.Text<>'')) or
((Form2.Edit4.Text='') and (Form2.Edit5.Text<>'')) or
((Form2.Edit5.Text='') and (Form2.Edit6.Text<>'')) or
((Form2.Edit6.Text='') and (Form2.Edit7.Text<>'')) or
((Form2.Edit7.Text='') and (Form2.Edit8.Text<>'')) or
((Form2.Edit8.Text='') and (Form2.Edit9.Text<>'')) or
((Form2.Edit9.Text='') and (Form2.Edit10.Text<>'')) then
begin
if Application.MessageBox('请依次输入候选人名字,不要在中间留空!','警告',0)=1 then
exit;
end;
if Form2.Edit1.Text='' then
begin
if Application.MessageBox('老大,一个候选人也没有,投给空气啊?!','警告',0)=1 then
exit;
end;
MainForm.Button1.Caption:=Form2.Edit1.Text;
MainForm.Button2.Caption:=Form2.Edit2.Text;
MainForm.Button3.Caption:=Form2.Edit3.Text;
MainForm.Button4.Caption:=Form2.Edit4.Text;
MainForm.Button5.Caption:=Form2.Edit5.Text;
MainForm.Button6.Caption:=Form2.Edit6.Text;
MainForm.Button7.Caption:=Form2.Edit7.Text;
MainForm.Button8.Caption:=Form2.Edit8.Text;
MainForm.Button9.Caption:=Form2.Edit9.Text;
MainForm.Button10.Caption:=Form2.Edit10.Text;
Form2.Close;
MainForm.Show;
MainForm.InputToolButton.Enabled:=False;
MainForm.InputCandidates.Enabled:=False;
MainForm.StartToolButton.Enabled:=True;
MainForm.StartCounting1.Enabled:=True;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -