Recent

Author Topic: Way to get rid of the maximize button?  (Read 3898 times)

futureguy

  • New Member
  • *
  • Posts: 22
Way to get rid of the maximize button?
« on: July 22, 2013, 02:57:51 pm »
Is there?

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: Way to get rid of the maximize button?
« Reply #1 on: July 22, 2013, 03:04:18 pm »
Can you give a little more information?

/BlueIcaro

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Way to get rid of the maximize button?
« Reply #2 on: July 22, 2013, 03:06:56 pm »
Take a look and property BorderIcons.  Uncheck biMaximize.
Lazarus Trunk / fpc 2.6.2 / Win32

DtC17

  • New Member
  • *
  • Posts: 13
Re: Way to get rid of the maximize button?
« Reply #3 on: August 02, 2013, 07:32:42 pm »
Related Questions:

1) even IF you get rid of Maximize/Minimize and especially the "general" application button, how do you counter alt-spacebar ? The button may not be there, but the functionality still is. I can intercept OnStateChange as a workaround, but I'd rather not see that menu pop up at all.

2) Is there a way to draw a form without titlebar but WITH standard OS borders? I'm currently using custom-drawn form (well actually, everything I do is "custom" :-) but nothing beats the speed of OS drawing...

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Way to get rid of the maximize button?
« Reply #4 on: August 02, 2013, 08:30:09 pm »
1) Look into WinAPI, if you are using Windows. There's propably no crossplatform solution for thick bordered title-less windows. But Windows 7 can do it i believe, i'm just not sure if you can change it on fly. These are normally creation parameters for window.

2) Based on this http://stackoverflow.com/questions/2277021/wpf-how-do-i-disable-the-systemmenu-shortcut-altspace
I tested on Lazarus, and this disables Alt+Space:
Code: [Select]
uses ... , LCLType;
...
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if (ssAlt in Shift) and (Key=VK_SPACE) then key:=0;
end;

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Way to get rid of the maximize button?
« Reply #5 on: August 03, 2013, 01:04:01 pm »
Did you try property BorderStyle?  BorderStyle:= bsDialog gives you only the Close button, but there are other Styles as well.
Lazarus Trunk / fpc 2.6.2 / Win32

 

TinyPortal © 2005-2018