Unplanned
Last Updated: 29 Mar 2016 14:16 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 08 Jul 2015 12:18
Category: Form
Type: Bug Report
1
FIX. RadForm - form is resized when the theme is changed and the form is shown on a second monitor with increased resolution compared to the main monitor
To reproduce: use the following code snippet:

public Form1()
{
    InitializeComponent();

    this.radDropDownList1.SelectedIndexChanged+=radDropDownList1_SelectedIndexChanged;
    this.radDropDownList1.Items.Add("TelerikMetro");
    this.radDropDownList1.Items.Add("Windows8");
    this.radDropDownList1.Items.Add("VisualStudio2012Dark");

    this.radDropDownList1.SelectedIndex = 1;

    this.SizeChanged+=Form1_SizeChanged;
}

private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    ThemeResolutionService.ApplicationThemeName = this.radDropDownList1.Text;
}

1. Use two monitors and decrease the screen resolution to the main monitor.
2. Run the application from the first monitor and move the form to the second monitor.
3. Resize the form on a way to increase the form's height to be greater than the height of the screen resolution of the main monitor.
4. Change the theme. You will notice that that form is resized.

Workaround:

public Form1()
{
    InitializeComponent();

    this.radDropDownList1.SelectedIndexChanged += radDropDownList1_SelectedIndexChanged;
    this.radDropDownList1.Items.Add("TelerikMetro");
    this.radDropDownList1.Items.Add("Windows8");
    this.radDropDownList1.Items.Add("VisualStudio2012Dark");

    this.radDropDownList1.SelectedIndex = 1;

    this.SizeChanged += Form1_SizeChanged;
}

private void Form1_SizeChanged(object sender, EventArgs e)
{
    if (fSize != Size.Empty)
    {
        this.SizeChanged-= Form1_SizeChanged;
        this.Size = fSize;
        
        this.SizeChanged += Form1_SizeChanged;
    }
}

Size fSize = Size.Empty;

private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    fSize = this.Size;
    ThemeResolutionService.ApplicationThemeName = this.radDropDownList1.Text;
    fSize=Size.Empty;
}
0 comments