This is a migrated thread and some comments may be shown as answers.

Image Alignment issue with a RadButtonElement in a RadRibbonBar

4 Answers 132 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Fraser Tustian
Top achievements
Rank 1
Fraser Tustian asked on 19 Jan 2009, 05:04 AM
Greetings!

I'm having trouble with the alignment (particularly vertically) of an image on a RadButtonElement that's in a RadRibbonBar. I hope I'm just missing something simple!

Here's the walkthrough:

  1. Create a new Windows application
  2. Drop a RadRibbonBar onto the form
  3. Click "Add New Tab" and name it "Test"
  4. Click "Add New Chunk..." under Test
  5. Right click the New Chunk and click "Add an item" > "Horizontal Button Group"
  6. Right click the space inside the new group and click "Add an item" > "RadTextBoxElement"
  7. Carefully right click the group again and this time click "Add an item" > "RadButtonElement"
  8. Change the button's image anything smaller than 16x16. For example, Common7\VS2008ImageLibrary\1033\Objects\24bit_bitmaps\share.bmp from the Visual Studio 2008 image library
  9. Change the button's display style to Image
  10. Change the button's MinSize.Height to 22

 

The button is now to the right of the text box, but the image is not vertically centred in the button (note that if you set the MinSize.Width to be large than the image's width, it will not be horizontally centred either).

Most importantly, changing the buttons' ImageAlignment does not appear to have any effect - it is still displayed only at the top of the button and not centered, regardless of the setting of this property.

Is there a way to get the image to display in the centre of the button in this instance?

Thanks!

Cheers,

FRASER TUSTIAN



Specs:
OS: Windows Vista SP1
.NET Version: 3.5
Telerik Libraries Referenced:
Telerik.WinControls.dll   8.0.0.0
Telerik.WinControls.UI.dll  8.0.0.0
TelerikCommon.dll   8.0.0.0

4 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 20 Jan 2009, 02:24 PM
Hi Fraser Tustian,

Thank you for writing.

I confirm that ImageAlignment property does not work as expected. We are working on completely improving RadRibbonBar layout system and many of the current issues will be addressed. Currently, you could work-around the described issue by setting Alignment directly on RadButtonElement ImageAndTextLayoutPanel:

this.radButtonElement1.Children[1].Alignment = ContentAlignment.MiddleCenter; 

Do not hesitate to contact me again if you have other questions.

All the best,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Fraser Tustian
Top achievements
Rank 1
answered on 20 Jan 2009, 09:10 PM
Martin,

Thankyou for your reply.

The workaround does the trick - thanks!

Cheers,

FRASER
0
Asaf
Top achievements
Rank 1
answered on 22 Jun 2009, 01:23 PM
hi,
i am having also prblems making the button in the ceter of the chunk.
no proprtiy does that.
any sugeations?

0
Martin Vasilev
Telerik team
answered on 24 Jun 2009, 04:53 PM
Hi Asaf,

Thank you for writing.

We did further improvements on the RadRibbon layouts and the alignment issue should be addressed in the upcoming release Q2 2009. Until than you could use ImageAndTextLayoutPanel's Alignment property as described in my previous message.

Do not hesitate to contact me again if you have other questions.
 

Regards,
Martin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
RibbonBar
Asked by
Fraser Tustian
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Fraser Tustian
Top achievements
Rank 1
Asaf
Top achievements
Rank 1
Share this question
or