Arsip: tanya disabled tombol close
more 19 years ago
ingusan
mo nanya mas2 sekalian...
gimana cara men-disabled kan tombol close pada form pada saat program di running ??
thanks be4
more 19 years ago
erwinkiting
kalau untuk menghilangkan tombol closenya saya tau
Properties->BorderIcons->biSystemMenu->False
tapi dengan cara diatas tombol Minimize dan Maximize juga hilang
more 19 years ago
wekswek
procedure TForm1.FormCloseQuery(Sender:TObject; var CanClose: Boolean);
begin
if titik...titik... then
CanClose := false;
end;
more 19 years ago
chipmunk
..disable tombol close tidak mencegah closing misal dg ALT-F4, tp bisa ditrap pada OnCloseQuery()...
utk men-disabled aja (system menu jg akan sinkron) coba code ini di OnCreate()
procedure TForm1.FormCreate(Sender: TObject);
var
mi : TMenuItemInfo;
hm: HMENU;
begin
hm := GetSystemMenu(Handle, false);
mi.cbSize := sizeof(TMenuiteminfo);
mi.fMask := MIIM_STATE;
GetMenuItemInfo(hm,SC_CLOSE,false,mi);
mi.fState := MFS_DISABLED;
SetMenuItemInfo(hm,SC_CLOSE,false,mi);
end;
btw, buat apa sih? :)
- chipmunk -
more 19 years ago
DelphiExpert
Betul bro Chipmunk bilang... disabled tombol close, app tetap bisa ditutup pake ALT+F4
Ato pake code berikut:
var
Flag: UINT;
AppSysMenu: THandle;
begin
AppSysMenu:=GetSystemMenu(Handle,False);
Flag:=MF_GRAYED;
EnableMenuItem(AppSysMenu,SC_CLOSE,MF_BYCOMMAND or Flag);
end;
untuk meng-enabled-kan pake parameter MF_ENABLED (Flag)
more 19 years ago
tox2wow
Nambahin dikit ... :D ... untuk disabled-nya udah bisa seperti yg dibilangin bung chipmunk sama bung DelphiExpert. Kalo yg gw kaya gini :
Procedure DisabledTombolClose;
var
MenuHandle: Integer;
begin
MenuHandle := GetSystemMenu(Handle, False);
if (MenuHandle <> 0) then
ModifyMenu(MenuHandle, SC_CLOSE, MF_BYCOMMAND or
MF_GRAYED or MF_DISABLED, SC_CLOSE, 'Close');
And untuk disabled ALT+F4 nya, kaya yg dibilangin wkeswek :
procedure TForm1.FormCloseQuery(Sender:TObject; var CanClose:Boolean);
begin
CanClose := False;
end;
Keep trying bro .. :P
more 19 years ago
ingusan
@chipmunk: ..disable tombol close tidak mencegah closing misal dg ALT-F4, tp bisa ditrap pada OnCloseQuery()... utk men-disabled aja (system menu jg akan sinkron) coba code ini di OnCreate()terimakasih kepada mas2 semua atas pencerahannya ... :D >>>btw, buat apa sih? :) ini untuk miniatur alat yang ane bikin(PKL) mas... jadi user ga bisa menghentikan program selama alat ini di running... ..... sekali lagi thanks.... VIVA Delphi indonesia.. :D- chipmunk -procedure TForm1.FormCreate(Sender: TObject); var mi : TMenuItemInfo; hm: HMENU; begin hm := GetSystemMenu(Handle, false); mi.cbSize := sizeof(TMenuiteminfo); mi.fMask := MIIM_STATE; GetMenuItemInfo(hm,SC_CLOSE,false,mi); mi.fState := MFS_DISABLED; SetMenuItemInfo(hm,SC_CLOSE,false,mi); end;
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward
🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 5 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 6 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 13 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 13 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 13 years ago
Random Topic
- tanya biner to matriks
by diandewi in Hal umum tentang Pascal Indonesia more 13 years ago - Membuat No Nota Secara Otomatis
by eni in Hal umum tentang Pascal Indonesia more 13 years ago - Interface MSSQL di client
by xmbohx in MsSQL more 18 years ago - bagaimana spy popup menu muncul otomatis (tanpa klik kanan)?
by ignisce in Tip n Trik Pemrograman more 17 years ago - APLIKASI PENUH untuk delphi
by ganang in Network, Files, I/O & System more 16 years ago - client server lemmmooth
by e_soep in Network, Files, I/O & System more 18 years ago - TProgress nggak muncul
by delphicode in Tutorial & Community Project more 16 years ago - OnKeypress tidak dieksekusi ?
by leman in Tip n Trik Pemrograman more 17 years ago - nampilin kode ASCII mode DOS
by jarangkonek in OOT more 18 years ago - fast report masih ga bisa
by h412fi in Reporting more 17 years ago