Вниз
Скачать: CL | DM;

TForm   Найти похожие ветки 

← →
gestern ©   (2004-01-01 17:12) [0]

Вопрос простой. Как сделать так что-бы форма не закрывалась Alt+F4


← →
Intell ©   (2004-01-01 17:44) [1]

procedure TForm1.FormCreate(Sender: TObject);
begin
KeyPreview := true;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((ssAlt in Shift) and (Key = VK_F4)) then Key := 0;
end;


← →
Intell ©   (2004-01-01 17:44) [2]

procedure TForm1.FormCreate(Sender: TObject);
begin
KeyPreview := true;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((ssAlt in Shift) and (Key = VK_F4)) then Key := 0;
end;


← →
raidan ©   (2004-01-01 20:05) [3]

А если хочешь, чтобы форма закрывалась только если нажата кнопка какая-нить (tbutton или еще что-нибудь), то проще поставить обработчик на OnCloseQuery.

var allowCloseForm:boolean;
В form.oncreate установить allowCloseForm:=false;
В tbutton.onclick установить allowCloseForm:=true;

В tform.onclosequery: if allowCloseForm then canClose:=true else canClose:=false;


← →
Номолос   (2004-01-01 22:28) [4]

Внимание! KeyPreview крупно глючит под XP!


← →
mike-d ©   (2004-01-02 12:00) [5]

Компонент TActionList. Добавляешь к нему один TAction (Action1) и назначаешь ему ShortCut = Alt+F4. Делаешь обработчик:

procedure TForm1.Action1Execute(Sender: TObject);
begin
ShowMessage("А вот фигушки!");
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.015 c
3-49399
Евгений
2003-12-19 14:33
2004.01.16
Причина сообщения Could not find language drive.


1-49481
miracle_fox
2004-01-04 13:18
2004.01.16
как сохранить в файл текст из richedit так, чтобы ...


6-49667
[mef]
2003-11-15 11:51
2004.01.16
инфа по WinSock


1-49515
Zilog_
2004-01-03 10:42
2004.01.16
Как создать окно во весь экран?


14-49756
KILLER_ABV
2003-12-22 12:17
2004.01.16
Помогите написать собственный TrayBar.




   Наверх