🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.vcl.components.using.general
2 messages
2 total messages Started by limelect Wed, 09 Jul 2008 09:09
pagecontrol buttons and screen resolution
#143
Author: limelect
Date: Wed, 09 Jul 2008 09:09
13 lines
1454 bytes
I would liker to place 4 buttons on pagecontrol (where there are no tabs) 
which i did.
How ever whene i use the program on diffrent resolution screen they are 
dislocated.
I used the code:

mainform.windowstate:=wsmaximized;( tried also after next lines!!!)

Button.parent:=pagecontrol1;
Button.top:=pagecontrol1.height-pagecontrol1.tabheight-3;
... more buttons

any idea what to do with screen resolution?
Re: pagecontrol buttons and screen resolution
#141
Author: Peter Below (TeamB)
Date: Wed, 09 Jul 2008 17:27
32 lines
2035 bytes
limelect wrote:

> I would liker to place 4 buttons on pagecontrol (where there are no
> tabs) which i did.  How ever whene i use the program on diffrent
> resolution screen they are dislocated.  I used the code:
> 
> mainform.windowstate:=wsmaximized;( tried also after next lines!!!)
> 
> Button.parent:=pagecontrol1;
> Button.top:=pagecontrol1.height-pagecontrol1.tabheight-3;
> ... more buttons
> 
> any idea what to do with screen resolution?

You are using the wrong properties. If you want to place a control in
its parents client area you use the parents ClientHeight and
ClientWidth as base. To wire the button to the pagecontrols lower edge
you would use

 Button.Top := pagecontrol1.Clientheight - button.Height;

for example. It is also important *where* you place this code. Since
the button needs to be moved when its parent changes in size you have
to use the parents OnResize event (if it has one). If it does not have
one use the Onresize event of the parents parent etc..

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads