This is a migrated thread and some comments may be shown as answers.
dropdownbutton image placement
3 Answers 44 Views
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 10 Jun 2007, 02:15 AM
I was under the impression that when you set the image position setting in the RadDropDownButton that is where the image is supposed to be displayed :) ... for example if I set the ImageAlignment to MiddleCenter (with no text included) then the image would be displayed in the middle of the button.

Unfortunately the image doesn't want to move from the TopLeft positions.

Here's the settingings being used:

DisplayStyle - Image

Image - 16x16 png file
ImageAlignment - MiddleCenter

Text - ""
TextAlignment - Middle Left
TextImageRelation - Overlay

Steven Hodson
WinExtra / Hodson Report
http://www.winextra.com
http://www.hodsonreport.com

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 11 Jun 2007, 10:14 AM
Hi Steven,

This happens because resizing the button doesn't resize the inner parts of the button (children in its hierarchy). ImageAlignment is effective only when there is a text  that is larger than the image (i.e. text with bigger height than the image).

To set the desired location of such an element as the image in the button, you should set the Alignment property of the ImageAntTextLayoutPanel of ActionButtonElement. This can be done either via the property grid at design-time, or by using the following code:

this.radDropDownButton1.RootElement.GetChildAt(0).GetChildAt(1).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;

Feel free to examine the structure of the RadDropDownButton in our examples with the RadControlSpy .

Please, let me know if this works fine for you.
 

Regards,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Steven
Top achievements
Rank 1
answered on 11 Jun 2007, 07:13 PM
okie dokie I managed to get it set via the designer but I gotta tell ya from an old tired brain this is a long way to be able to center an image LOL

Steven Hodson
WinExtra / Hodson Report
http://www.winextra.com
http://www.hodsonreport.com
0
Georgi
Telerik team
answered on 12 Jun 2007, 01:38 PM
Hi Steven,

We're constantly working on improving our controls and this issue will most likely get into our TODO list for the future releases. Thanks for the feedback, as always.

 
Best wishes,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Asked by
Steven
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Steven
Top achievements
Rank 1
Share this question
or