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

VSplit Cursor not Scaling in DPI Aware App

7 Answers 196 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Iron
Robert asked on 13 Sep 2017, 05:00 PM

Hello, 

The VSplit cursor does not seem to be scaling in DPI aware applications. It's not too bad up to 150% scale. But 200% scale or higher the cursor is almost invisible. This also seems to be the case for the SplitContainer control. Is there a solution for that?

Robert

 

7 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 14 Sep 2017, 08:46 AM
Hello Robert,

Thank you for writing.

RadSplitContainer is using the default Cursors.VSplit and Cursors.. These cursors indeed do not seem to be scaled correctly. The issue is with Microsoft and not related to the split container or any of our controls. You can reproduce it in a standard dpi-aware form with the following: 
this.Cursor = Cursors.VSplit;

Due to the nature of the reported issue, I cannot suggest a suitable workaround.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Robert
Top achievements
Rank 1
Iron
answered on 15 Sep 2017, 03:30 PM
Would there be a way to switch cursors? I was thinking maybe if scale is greater 150% the VSplit cursor could be switched for the SizeWE cursor which does seem to scale correctly at higher resolutions.
0
Hristo
Telerik team
answered on 18 Sep 2017, 11:44 AM
Hello Robert,

Thank you for writing.

In RadSplitContainer, you can accomplish this task by creating a custom control and overriding its Cursor property as well as the MouseMove and MouseDown methods: 
public class MyRadSplitContainer : RadSplitContainer
{
    private bool isResizing;
 
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadSplitContainer).FullName;
        }
    }
 
    protected override void OnMouseDown(MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Left && this.ContentRectangle.Contains(e.Location))
        {
            SplitterElement splitter = GetSplitterElementAtPoint(e.Location);
            if (splitter != null && !splitter.Fixed)
            {
                this.isResizing = true;
            }
 
            base.OnMouseDown(e);
        }
    }
 
    protected override void OnMouseUp(MouseEventArgs e)
    {
        base.OnMouseUp(e);
 
        this.isResizing = false;
    }
 
    public override Cursor Cursor
    {
        get
        {
            Cursor cursor = base.Cursor;
            if (this.isResizing && cursor == Cursors.SizeWE)
            {
                cursor = Cursors.VSplit;
            }
            else if (this.isResizing && cursor == Cursors.SizeNS)
            {
                cursor = Cursors.HSplit;
            }
 
            return cursor;
        }
        set
        {
            if (value == Cursors.VSplit)
            {
                value = Cursors.SizeWE;
            }
            else if (value == Cursors.HSplit)
            {
                value = Cursors.SizeNS;
            }
 
            base.Cursor = value;
        }
    }
}

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Robert
Top achievements
Rank 1
Iron
answered on 18 Sep 2017, 04:18 PM

That works quite nicely. Thank you. Also works for RadDock with code change to this.isResizing2.

Robert

0
Hristo
Telerik team
answered on 19 Sep 2017, 07:32 AM
Hello Robert,

Thank you for the update.

I am glad that the suggested approach is working well in your actual project.

Please let me know if you have other questions.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
David
Top achievements
Rank 1
answered on 16 Nov 2018, 02:14 AM
It worked for me too. May I suggest a small feature improvement: simply to allow the split cursor to be set by the programmer?
0
Hristo
Telerik team
answered on 16 Nov 2018, 09:48 AM
Hi David,

I agree that this small feature would be a nice improvement in the RadSplitContainer. I have logged the feature request on our feedback portal, here: ADD. RadSplitContainer - option for defining the resizing cursor. I have also updated your Telerik points. We will do our best to implement to the new feature for the R1 2019 release.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Dock
Asked by
Robert
Top achievements
Rank 1
Iron
Answers by
Hristo
Telerik team
Robert
Top achievements
Rank 1
Iron
David
Top achievements
Rank 1
Share this question
or