Image Alignment issue with a RadButtonElement in a RadRibbonBar

5 posts, 0 answers
  1. Fraser Tustian
    Fraser Tustian avatar
    18 posts
    Member since:
    Sep 2012

    Posted 18 Jan 2009 Link to this post

    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

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 20 Jan 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Fraser Tustian
    Fraser Tustian avatar
    18 posts
    Member since:
    Sep 2012

    Posted 20 Jan 2009 Link to this post

    Martin,

    Thankyou for your reply.

    The workaround does the trick - thanks!

    Cheers,

    FRASER
  5. Asaf
    Asaf avatar
    1 posts
    Member since:
    Jun 2009

    Posted 22 Jun 2009 Link to this post

    hi,
    i am having also prblems making the button in the ceter of the chunk.
    no proprtiy does that.
    any sugeations?

  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 24 Jun 2009 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready