Mega Search
23.2 Million


Sign Up

Make a donation  
TButton with images spacing between the image and caption...  
News Group: embarcadero.public.delphi.vcl.components.using

Have just moved to XE7 from Delphi 5.  Started going through each component looking at the different properties.  I am playing around with the Images property.  I am trying to figure out how to define the spacing between the image that is displayed and the caption on the button.

For instance, I set the image alignment to iaLeft and the imageMargin to 10.  Well after the image I would like to leave 20 pixels between the image and the caption.  How would I go about doing this?


Thanks,

Zero.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 7-Jan-2015, at 10:27 AM EST
From: James Foreman
 
Re: TButton with images spacing between the image and captio  
News Group: embarcadero.public.delphi.vcl.components.using
James Foreman wrote:

> Have just moved to XE7 from Delphi 5.  Started going through each
> component looking at the different properties.  I am playing around
> with the Images property.  I am trying to figure out how to define
> the spacing between the image that is displayed and the caption on
> the button.
> 
> For instance, I set the image alignment to iaLeft and the imageMargin
> to 10.  Well after the image I would like to leave 20 pixels between
> the image and the caption.  How would I go about doing this?

Imagemargins is a record property, you set imagemargins.left to define
the spacing between image and left button border, and
imagemargins.right to define the spacing between the image and the
button's text area. The problem is that the button draws the caption
horizontally centered in the text area, as far as I know (at least for
vcl's TButton), so the position of the caption left edge depends on the
text width.



-- 
Peter Below (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 7-Jan-2015, at 10:48 AM EST
From: Peter Below