mysql[i].caption 到 editbox.text on delphi 7
mysq[i].caption into editbox.text on delphi 7
当我只想要字母时,我一直在使用这个程序获取完整的字母表。
我如何获得特定的字母?
var
Form1: TForm1;
mysq : array[1..26] of TPanel;
implementation
…
procedure TForm1.mySqMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
i, a: integer;
begin
a := StrToInt(lab_leftn.Caption);
lab_leftn.Caption := IntToStr(a - 1);
if lab_leftn.Caption = IntToStr(0) then
begin
ShowMessage('You have lost');
lab_leftn.Caption := IntToStr(0);
end;
for i := 1 to 26 do
ed_guessed.Text := ed_guessed.Text + mysq[i].Caption;
end;
假设 mySqMouseDown 已分配给所有 TPanel OnMouseDown 事件,那么正确的代码是:
procedure TForm1.mySqMouseDown(
Sender : TObject;
Button : TMouseButton;
Shift : TShiftState;
X, Y : Integer);
var
i, a: integer;
begin
a := StrToInt(lab_leftn.Caption);
lab_leftn.Caption := IntToStr(a - 1);
if lab_leftn.Caption = IntToStr(0) then begin
ShowMessage('You have lost');
lab_leftn.Caption := IntToStr(0);
end;
ed_guessed.Text := (Sender as TPanel).Caption;
end;
当我只想要字母时,我一直在使用这个程序获取完整的字母表。 我如何获得特定的字母?
var
Form1: TForm1;
mysq : array[1..26] of TPanel;
implementation
…
procedure TForm1.mySqMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
i, a: integer;
begin
a := StrToInt(lab_leftn.Caption);
lab_leftn.Caption := IntToStr(a - 1);
if lab_leftn.Caption = IntToStr(0) then
begin
ShowMessage('You have lost');
lab_leftn.Caption := IntToStr(0);
end;
for i := 1 to 26 do
ed_guessed.Text := ed_guessed.Text + mysq[i].Caption;
end;
假设 mySqMouseDown 已分配给所有 TPanel OnMouseDown 事件,那么正确的代码是:
procedure TForm1.mySqMouseDown(
Sender : TObject;
Button : TMouseButton;
Shift : TShiftState;
X, Y : Integer);
var
i, a: integer;
begin
a := StrToInt(lab_leftn.Caption);
lab_leftn.Caption := IntToStr(a - 1);
if lab_leftn.Caption = IntToStr(0) then begin
ShowMessage('You have lost');
lab_leftn.Caption := IntToStr(0);
end;
ed_guessed.Text := (Sender as TPanel).Caption;
end;