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

VSB ImageLayout not taking effect

1 Answer 165 Views
Tools - VSB, Control Spy, Shape Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 22 Apr 2014, 07:12 AM
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.

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 25 Apr 2014, 06:47 AM
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.
 
Tags
Tools - VSB, Control Spy, Shape Editor
Asked by
Michael
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or