Unplanned
Last Updated: 29 Mar 2016 14:16 by ADMIN
ADMIN
Dimitar
Created on: 24 Aug 2015 07:32
Category: Form
Type: Bug Report
0
FIX. RadForm - there is additional space around the form when the MaximizedBounds is set and the form is maximized, there is flickering when the from state is changed as well.
To reproduce: 
- Set the MaximizedBounds property so the form takes the entire right part of the screen, the change the windows state at runtime:
private void radButton1_Click(object sender, EventArgs e)
{
    setFormMaximizedBounds(200);
}

private void radButton2_Click(object sender, EventArgs e)
{
    setFormMaximizedBounds(-1);
}
private void setFormMaximizedBounds(int distance)
{
    if (distance >= 0)
    {
        var ownerScreen = Screen.FromControl(this);
        var workingArea = ownerScreen.WorkingArea;
        var x = workingArea.X + distance;
        var y = workingArea.Y;
        var w = workingArea.Width - distance;
        var h = workingArea.Height;
        this.MaximizedBounds = new Rectangle(x, y, w, h);
    }
    else
    {
        this.MaximizedBounds = new Rectangle(0, 0, 0, 0);
    }

    if (this.WindowState == FormWindowState.Maximized)
    {
        this.WindowState = FormWindowState.Normal;
        this.WindowState = FormWindowState.Maximized;
    }
}

0 comments