VSB ImageLayout not taking effect

2 posts, 0 answers
  1. Michael
    Michael avatar
    3 posts
    Member since:
    Mar 2014

    Posted 22 Apr 2014 Link to this post

    I have 3 Images (as repository items) one for default, one for mouseOver and one for mouseDown. Each Image has the ImageLayout property set to "stretch" . Additionaly I have set the ImageLayout for the RadButton/RadButtonElement/ImagePrimitive to stretch. However, the Images refuse to stretch...

    Any help would be appreciated.
  2. George
    Admin
    George avatar
    500 posts

    Posted 25 Apr 2014 Link to this post

    Hello Michael,

    Thank you for contacting us.

    I can confirm this issue with RadButton and VisualStyleBuilder. Due to the nature of the issue I cannot provide you with a direct workaround. You can, however use a custom control which uses LightVisualElement​ which supports this functionality:
    [ToolboxItem(true)]
    public class RadLightVisualButton : RadControl
    {
        private RadLightVisualButtonElement buttonElement;
     
     
        public RadLightVisualButtonElement ButtonElement
        {
            get
            {
                return buttonElement;
            }
        }
     
     
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);
     
     
            this.buttonElement = new RadLightVisualButtonElement();
            parent.Children.Add(this.buttonElement);
        }
    }
     
     
    public class RadLightVisualButtonElement : LightVisualElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(LightVisualElement);
            }
        }
    }

    You can find this issue, and the issue where you cannot set the Image​ of the ImagePrimitive​ in VSB here: UI for Winforms Feedback Portal - FIX. ImagePrimitive - Setting ImageLayout has no effect and here: UI for Winforms Feedback Portal - FIX. VisualStyleBuilder - Setting the Image property of RadButtonElement has no effect.

    I have also updated your Telerik Points for reporting this.

    Let me know if you have further questions.

    Regards,
    George
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top