dropdownbutton image placement

4 posts, 0 answers
  1. Steven
    Steven avatar
    28 posts
    Member since:
    May 2007

    Posted 09 Jun 2007 Link to this post

    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
  2. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 11 Jun 2007 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Steven
    Steven avatar
    28 posts
    Member since:
    May 2007

    Posted 11 Jun 2007 Link to this post

    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
  5. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 12 Jun 2007 Link to this post

    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
Back to Top