Recent

Author Topic: how to hide close window in dialog?  (Read 6712 times)

midisa

  • Jr. Member
  • **
  • Posts: 53
  • ISV Developer
how to hide close window in dialog?
« on: December 03, 2013, 10:55:47 am »
how to hide close window in dialog?
please look picture.
thank you.
My system: Linux Fedora 64 bit + Mate 1.6.1. Lazarus ver. 1.1.
If you answer my question, I ask you to write in detail because I find it difficult to understand English.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 792
    • Blog personal
Re: how to hide close window in dialog?
« Reply #1 on: December 03, 2013, 11:15:27 am »
Hello, searching in Google, I found this:
Quote
How do I disable the [ X ] close button on forms?  http://www.tek-tips.com/faqs.cfm?fid=7515

I tested on Lazarus 1.14-W7, and it works. But I affraid is only form windows.

/BlueIcaro

midisa

  • Jr. Member
  • **
  • Posts: 53
  • ISV Developer
Re: how to hide close window in dialog?
« Reply #2 on: December 03, 2013, 11:21:24 am »
thank you.
link not opened ...  :(.
if use in linux mate, button show ....
« Last Edit: December 03, 2013, 11:25:00 am by midisa »
My system: Linux Fedora 64 bit + Mate 1.6.1. Lazarus ver. 1.1.
If you answer my question, I ask you to write in detail because I find it difficult to understand English.

midisa

  • Jr. Member
  • **
  • Posts: 53
  • ISV Developer
Re: how to hide close window in dialog?
« Reply #3 on: December 03, 2013, 11:33:49 am »
i found answer:

Code: [Select]
procedure Tf_name.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  if b_close = false then begin
    CloseAction := caNone;
  end;
end;

http://forum.lazarus.freepascal.org/index.php?topic=12132.0

thank you to all.
topic close.
My system: Linux Fedora 64 bit + Mate 1.6.1. Lazarus ver. 1.1.
If you answer my question, I ask you to write in detail because I find it difficult to understand English.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: how to hide close window in dialog?
« Reply #4 on: December 03, 2013, 11:48:01 am »
You went around the problem by leaving the 'X' there, just not doing anything when clicking it. So it may be solved for you, but as a topic it is not, if someone in the future is looking for it.

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: how to hide close window in dialog?
« Reply #5 on: December 03, 2013, 12:47:06 pm »
Set Form's BorderStyle property to bsNone.

CM630

  • Hero Member
  • *****
  • Posts: 1089
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: how to hide close window in dialog?
« Reply #6 on: July 24, 2017, 04:11:49 pm »
This way the Maximize and Minize buttons are gone too.
And, the form cannot be dragged.
« Last Edit: August 16, 2019, 07:23:51 am by CM630 »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: how to hide close window in dialog?
« Reply #7 on: July 25, 2017, 05:03:22 am »
bsNone is not necessary, at least not in LAZARUS 1.6.4 FPC 3.0.2...   :D
Yeah... I don't know if this works under Linux the same way and I don't know if this was always the case in any LAZARUS version...

At least on WINDOWS it works now...  :P
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: how to hide close window in dialog?
« Reply #8 on: July 25, 2017, 05:31:47 am »
I tried on my Ubuntu Mate, the close button cannot be hidden unless we set the form style to bsNone as suggested by Zoran, but bsNone will hide all the title bar so the form cannot be dragged. I think User137's suggestion is the best, but if the close button really needed to be hidden, you can try to set the form style to bsNone and use the trick as discussed in this thread:
http://forum.lazarus.freepascal.org/index.php/topic,36831.0.html

CM630

  • Hero Member
  • *****
  • Posts: 1089
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: how to hide close window in dialog?
« Reply #9 on: July 25, 2017, 06:51:10 am »
My issue is that I want to hide tha Close button only and keep the minimize and maximize ones  :(
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14363
  • Sensorship about opinions does not belong here.
Re: how to hide close window in dialog?
« Reply #10 on: July 25, 2017, 09:19:19 am »
The problem is that not every underlying widget set supports that E.g. GTK won't allow it. But in Windows it works. There's little Lazarus can do about GTK(+)(2)(3).
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018