Completed
Last Updated: 15 Aug 2017 11:03 by ADMIN
ADMIN
Hristo
Created on: 26 Jun 2017 14:22
Category: SplitContainer
Type: Bug Report
0
FIX. RadSplitContainer - the layout element holding the resizing grip and splitter buttons should not be visible if the splitter element has its Fixed property set to true
The mouse cursor should not also change to split.

How to reproduce: set certain splitter elements to be fixed, then you would notice that they have the resizing image visible and the cursor changes to split if you hover them

Workaround: manually hide the layout element and use a custom control overriding its Cursor property
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        new RadControlSpyForm().Show();

        this.radSplitContainer1.EnableCollapsing = true;
        this.radSplitContainer1.UseSplitterButtons = true;
    }

    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);

        foreach (SplitterElement splitter in this.radSplitContainer1.Splitters)
        {
            splitter.Fixed = true;
            splitter.Layout.Visibility = ElementVisibility.Collapsed;
        }
    }

    private void button1_Click(object sender, EventArgs e)
    {
        foreach (SplitterElement splitter in this.radSplitContainer1.Splitters)
        {
            splitter.Fixed = !splitter.Fixed;
            splitter.Layout.Visibility = !splitter.Fixed ? ElementVisibility.Visible : ElementVisibility.Collapsed;
        }
    }
}

public class MyRadSplitContainer : RadSplitContainer
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadSplitContainer).FullName;
        }
    }

    public override Cursor Cursor
    {
        get
        {
            return base.Cursor;
        }
        set
        {
            SplitterElement splitter = this.GetSplitterElementAtPoint(this.PointToClient(Cursor.Position));
            if (!(splitter != null && splitter.Fixed))
            {
                base.Cursor = value;
            }
        }
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments