Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-10

How do you remove form caption area?

9 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter
to leledumbo
BorderStyle := bsNone

And that removes the border. See the original linked screenshot.

http://codebot.org/snapshops/no-caption.jpg

leledumbo wrote 15 lines
BorderStyle := bsNone -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-do-you-remove-form-caption-area-tp4033716p4033717.html Sent from the Free Pascal - Lazarus mailing list . -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131005/e38cd793/attachment.html>

Reply by email

silvioprog
to leledumbo
uses
  unit2;
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  Form2.ShowModal;
  Form2.Free;
end;

---

uses
  Windows;
procedure TForm2.FormShow(Sender: TObject);
begin
  SetWindowLong(Handle, GWL_STYLE,
    GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));
  SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
    SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);
end;
Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131005/f75eddeb/attachment.html>

Reply by email

silvioprog
to silvioprog

2013/10/5 silvioprog

Show quoted text 23 lines
uses unit2; procedure TForm1.Button1Click(Sender: TObject); begin Form2 := TForm2.Create(Self); Form2.ShowModal; Form2.Free; end; --- uses Windows; procedure TForm2.FormShow(Sender: TObject); begin SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION)); SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE); end;

In mainform:

unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Windows, Forms;
type
  { TForm1 }
  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    procedure WMNCHitTest(var Msg: TMessage); message WM_NCHITTEST;
  end;
var
  Form1: TForm1;
implementation
{$R *.lfm}
procedure TForm1.FormShow(Sender: TObject);
begin
  SetWindowLong(Handle, GWL_STYLE, WS_OVERLAPPEDWINDOW and (not
WS_CAPTION));
  SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or
    SWP_NOMOVE or SWP_NOSIZE);
end;
procedure TForm1.WMNCHitTest(var Msg: TMessage);
begin
  inherited;
  case Msg.Result of
    HTTOP: Msg.Result := HTCLIENT;
    HTTOPLEFT: Msg.Result := HTCLIENT;
    HTTOPRIGHT: Msg.Result := HTCLIENT;
    HTBOTTOM: Msg.Result := HTCLIENT;
    HTBOTTOMLEFT: Msg.Result := HTCLIENT;
    HTBOTTOMRIGHT: Msg.Result := HTCLIENT;
    HTLEFT: Msg.Result := HTCLIENT;
    HTRIGHT: Msg.Result := HTCLIENT;
  end;
end;
end.
Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131005/f9e150c1/attachment.html>

Reply by email

Graeme Geldenhuys
to silvioprog: uses unit2; procedure TForm1.Button1Click(Sender: TObject); begin Form2 :=…
silvioprog wrote 7 lines
procedure TForm2.FormShow(Sender: TObject); begin SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION)); SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE); end;

Does LCL not have a TPopupWindow class? eg: like you would use for Hint Windows, Splash Screens etc? Weird.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Howard Page-Clark
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Does LCL not have a TPopupWindow class? eg: like you would use for Hint Windows, Splash Screens etc? Weird.

There is THintWindow in the Forms unit, but AFAIK it does not allow the kind of border the OP wants without resorting to calls such as SetWindowPos of which silvio gave an example.

Reply by email

Zaher Dirkey
to silvioprog: uses unit2; procedure TForm1.Button1Click(Sender: TObject); begin Form2 :=…

In Delphi we set Caption to '' and BorderIcons = [] but that not work in Lazarus

silvioprog wrote 34 lines
uses unit2; procedure TForm1.Button1Click(Sender: TObject); begin Form2 := TForm2.Create(Self); Form2.ShowModal; Form2.Free; end; --- uses Windows; procedure TForm2.FormShow(Sender: TObject); begin SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION)); SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE); end; -- Silvio Cl?cio My public projects - github.com/silvioprog -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3 Best Regards Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131005/7496ac51/attachment.html>

Reply by email