You may have wanted to create a form that doesn’t have a caption bar, just like the one’s you may see in setup programs. Delphi VCL doesn’t give you but you can also use the Windows API ![]()
Just add this code to you form’s OnCreate method:
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and not WS_CAPTION); Height := Height - GetSystemMetrics(SM_CYCAPTION);
That’s right! Just two lines of code…
Tags: caption, caption bar, code, Delphi, delphi vcl, example, form, free, move, object pascal, open source, setup programs, source, source code, tip, title, trick, window, windows api
Merlin’s Delphi Forge
Leave a comment