ShapedForm working as expected?

1 Answer 92 Views
ShapedForm
Martin
Top achievements
Rank 1
Martin asked on 14 Nov 2022, 01:09 PM

Hello!

The ShapedForm seems to suffer from a few problems:

1. The Shape doesn't honor the Bottom/Top Left/Right Rounded properties at all. No matter what those properties are set to, I always get rounded corners. The attached screenshot should have the top left and bottom left corner rounded only, but shows all corners rounded.

2. When using a border, it is cut off on the right top and right bottom corner (see screenshots). Depending on the border width, it is missing completely.

3. Even when the title bar is removed, the dialog can be moved by the mouse. While this is a handy feature, it also means that double-clicking on the top area of the shaped form will maximize the form and that's definitively not wanted.

 

Can we expect to have those bugs fixed in the near future since they severely limit the usability of this shaped form.
It simply doesn't look good that way and I'd rather resort to have a form background image with transparency key.

 

Martin

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 17 Nov 2022, 09:03 AM

Hi Martin,

Thank you for the provided details.

I have tested your approach and I am assuming that the RoundRectShape shape is applied to the Shape property of the form. Removing the radius of some of the corners is controlled from the BottomLeftRoundedTopLeftRoundedBottomRightRounded, and TopRightRounded. After testing this the border-radius is removed however, the ShapeForm content area remains clipped. That is why you observe this clipping and it looks like the mentioned above properties are not respected. I can confirm that this behavior is unexpected and therefore I have logged it on your behalf in our Feedback Portal where you can track the progress of the item. As a workaround, you can override the IsRectangularShape() method of the ShapedForm and return false. I have updated your Telerik Points for bringing this behavior to our attention.

public partial class Form1 : Telerik.WinControls.UI.ShapedForm
{
    public Form1()
    {
        InitializeComponent();
        new RadControlSpyForm().Show();
        this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
        this.Load += Form1_Load;

    }
    protected override bool IsRectangularShape(ref int radius)
    {
        return false;
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        this.BorderColor = Color.Red;
        this.BorderWidth = 2;
        RoundRectShape roundRectShape = new RoundRectShape();
        roundRectShape.Radius = 30;
        roundRectShape.BottomRightRounded = false;
        roundRectShape.TopLeftRounded = false;
        this.Shape = roundRectShape;
    }
}

As for your third question you can set the FormBorderStyle property to FormBorderStyle.FixedToolWindow. This way the ShapeForm won't be draggable and the maximize state with mouse double-click will be disabled.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ShapedForm
Asked by
Martin
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or