Completed
Last Updated: 19 Nov 2018 10:26 by ADMIN
ADMIN
Hristo
Created on: 16 Nov 2018 09:00
Category: SplitContainer
Type: Feature Request
1
ADD. RadSplitContainer - option for defining the resizing cursor
The end user should be able to specify what Cursor to be used while resizing a panel.

Currently this can be achieved using the custom control below:
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;
        }
    }
}
1 comment
ADMIN
Dimitar
Posted on: 19 Nov 2018 10:26
RadSplitContainer resizing cursor can now be changed using the following properties: HorizontalResizeCursor, VerticalResizeCursor

Example:
radSplitContainer1.HorizontalResizeCursor = Cursors.Cross;