Recent

Author Topic: [SOLVED] Form without caption  (Read 13527 times)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: Form without caption
« Reply #15 on: July 09, 2014, 03:57:46 pm »
borderstyle := bsDialog also I wouldn't use the onactivate at all I think that calling setwindowlong from formcreate
So in OnFormCreate we get this effect (see 1st attachment)

2 howardpc

I changed your code to the window size remains the same
Code: [Select]
MoveWindow(Handle, Left, Top, Width-1, Height + GetSystemMetrics(SM_CYCAPTION), True);
=====================================

Update: problem solved

Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin

Position:= poDesigned;

//warning: define form position here !!!
//Self.Left:= ...
//Self.Top:= ...

Label2.Caption:= Format('DesignTime Width = %d px', [Width]);
Label3.Caption:= Format('DesignTime Height = %d px', [Height]);

BorderStyle:= bsSizeable;

SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and (not WS_DLGFRAME));

with Constraints do
  begin
    MaxHeight:= Height - GetSystemMetrics(SM_CYCAPTION);
    MinHeight:= Height - GetSystemMetrics(SM_CYCAPTION);
    MaxWidth:= Width;
    MinWidth:= Width;
  end;

Label4.Caption:= Format('RunTime Width = %d px', [Width]);
Label5.Caption:= Format('RunTime Height = %d px', [Constraints.MaxHeight]); 
end; 
 


Thank you so much for your advice and comments   :)
« Last Edit: July 11, 2014, 03:31:45 pm by zoltanleo »
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

 

TinyPortal © 2005-2018