Página 1 de 1

bsSIZEABLE and no title bar

Publicado: Vie Dic 01, 2023 8:29 am
por Timm
Hi!

Is it possible to hide the title bar in a form that uses nBorderStyle = bsSIZEABLE?
I would like to create my own close, minimize and maximize buttons.

Greetings, Timm

Re: bsSIZEABLE and no title bar

Publicado: Sab Dic 02, 2023 6:45 pm
por jfgimenez
Hi Timm,

test this project ;-)
Sizeable.zip
(2.34 KiB) Descargado 93 veces

Re: bsSIZEABLE and no title bar

Publicado: Mar Dic 05, 2023 7:41 am
por Timm
Hi José,

works great, many thanks!

Now I am facing two problems:
- The form overlaps the task bar. I solved it with ::nHeight := Screen:nClientHeight in FormShow, but perhaps there is a better way.
- I do not know how to make it movable with the mouse

Greetings, Timm

Re: bsSIZEABLE and no title bar

Publicado: Mar Dic 05, 2023 12:12 pm
por jfgimenez
Hi Timm,

just change HTCLIENT into HTCAPTION at the beginning of WMNCHitTest(). That way, it's possible to drag the form by clicking anywhere on it.

Also, take a look at TCalculator source code. There you can see how to limit the movement inside the screen edges (methods WMNCLButtonDown and WMMoving, both written in C at the bottom).