I have been pulling my hair out with this one for a while now. I am resizing a form based on the top + height of the bottom most control on a form. Something like:

form1.height = Text18.top + Text18.height

if you try this you'll see that it doesn't display all of Text18. I know that this is due to the height of the titlebar being included in the height of the form but not in the top property of the text box. So this brings me to either having to do something like:

form1.height = Text18.top + Text18.height + 500

the 500 is to make up for the titlebar height, however this isn't the real height of the titlebar and titlebar heights can change from system to system, so what I really need to do is something more like:

form1.height = Text18.top + Text18.height + Titlebar.height

Titlebar unfortunatly isn't an object though and hence doesn't have a height property so I need some way of getting the titlebar height in either twips or pixels, twips would be better but I can convert between them. So if you know of a way to get the Titlebar height or some other way of coping with this I would really appreciate it if you would help me out with the code.

Thanks in advance.