卷 卷起千堆雪tyn Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-18 #2 procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end;
procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end;
D dhl2001 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-18 #6 放一个BUTTON可见, cancel:=true onclick close
風 風 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-18 #7 procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=#27 then Close; end;
procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=#27 then Close; end;
U ugvanxk Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-18 #9 FormKeyUp if Key=#27 then Close;
L luyear Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-18 #10 這個問題也那麼多人討論 如果按dhl2001的那種寫法 模式對話框不用任何代碼就可以用Esc關閉Form
J jrq Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-19 #13 to wanglong2 > 如果此时焦点在一个edit框里呢? 应该这样写: procedure TForm1.Edit1KeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end; :) 用卷老大的现成的!!
to wanglong2 > 如果此时焦点在一个edit框里呢? 应该这样写: procedure TForm1.Edit1KeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end; :) 用卷老大的现成的!!
B blue girl Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-19 #14 设置Form的 KeyPreview=True procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end;
设置Form的 KeyPreview=True procedure TForm1.FormKeyDown(Sender: TObject var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Close; end;