In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

bsSIZEABLE and no title bar

Xailer professional forum in English
Responder
Timm
Mensajes: 136
Registrado: Lun Jun 21, 2010 11:01 am

bsSIZEABLE and no title bar

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: bsSIZEABLE and no title bar

Mensaje por jfgimenez »

Hi Timm,

test this project ;-)
Sizeable.zip
(2.34 KiB) Descargado 53 veces
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Timm
Mensajes: 136
Registrado: Lun Jun 21, 2010 11:01 am

Re: bsSIZEABLE and no title bar

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: bsSIZEABLE and no title bar

Mensaje 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).
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder