Langsung ke konten utama

Postingan

Menampilkan postingan dari Maret, 2010

How can I prevent the user from closing a form?

To prevent the user from closing a form you need to disable the close button in the title bar of a form and at the same time disable the "Close" menu item in the form's system menu. This is done by calling the EnableMenuItem API function (see the example below). To prevent the user from closing a form you need to disable the close button in the title bar of a form and at the same time disable the "Close" menu item in the form's system menu. This is done by calling the EnableMenuItem API function (see the example below). Nonetheless, the user can still close the form using the Alt+F4 key combination, so we have to set the KeyPreview form property to True and write an event handler for the OnKeyDown event to cancel out this hot key: procedure TForm1.FormCreate(Sender: TObject); var hSysMenu: HMENU; begin hSysMenu := GetSystemMenu(Self.Handle, False); if hSysMenu <> 0 then begin EnableMenuItem(hSysMenu, SC_CLOSE, MF_BYCOMMAND Or MF_GRA...

FreeVCS Menu Disappears On Delphi 7. How to Fix It?

Obviously Borland introduced no serious changes in the VCS interface, therefore the current FreeVCS IDE version seems to work without problems. Obviously Borland introduced no serious changes in the VCS interface, therefore the current FreeVCS IDE version seems to work without problems. Of course the actual setup program offers no option to set registry keys for the D6/D7 IDE but you can simply create the related entry by yourself: - Create a new reg key "HKCU\Software\Borland\Delphi\6.0(or 7.0)\Version Control". (Remember the space between 'Version' and 'Control') - Create a new string value named "VCSManager". (No space between 'VCS' and 'Manager') - Enter full path and name of the FreeVCS DLL. (Example : c: C:\Program Files\FreeVCS\freevcs.dll) Restart the D6/D7 IDE and the FreeVCS Menu should be there... There is only one known problem related to D6/D7 for now: On some installations you may see the...