Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ClientHeight
Tue, Oct 13 2015 8:38 AMPermanent Link

Matthew Jones

I can't find where I think I raised this before (XanaNews not good on
searching!) but I hit it again so I think it worth raising separately.

Basically, I fill up a form with content, and want to have its height
set according to that content. Measuring the content is easy, but
setting the Height of the form is hard, as I have no idea how big the
"chrome" is. In EWB 1 there was a ClientHieght property that could be
set, and that solved the problem. Is there a way in EWB 2 of doing the
same, so that the code is independent of the UI element appearance etc?

--

Matthew Jones
Tue, Oct 13 2015 11:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Basically, I fill up a form with content, and want to have its height set according to that content. Measuring the content is easy, but setting the Height of the form is hard, as I have no idea how big the "chrome" is. In EWB 1 there was a ClientHieght property that could be set, and that solved the problem. Is there a way in EWB 2 of doing the same, so that the code is independent of the UI element appearance etc? >>

No, you have to manually subtract out the borders and padding.  Luckily, there's an easy way to do this:

Control.Height:=(Control.Height-Control.ClientHeight)+NewClientHeight;

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 13 2015 12:01 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> ClientHeight

Indeed - I found that this was available as a readable value, and that
allows one to work out the necessary. Thank you. (Also for the update,
yay!)

--

Matthew Jones
Image