Reputation: 3020
I've got this code in a pair of button click event handlers on a C# form:
class frmLogin
{
private const int SHORT_HEIGHT = 120;
private const int LONG_HEIGHT = 220;
private EventHandler ExpandHandler;
private EventHandler ShrinkHandler;
public frmLogin()
{
InitializeComponent();
ExpandHandler = new EventHandler(btnExpand_Click);
ShrinkHandler = new EventHandler(btnShrink_Click);
btnExpand.Click += ExpandHandler;
}
private void btnExpand_Click(object sender, EventArgs e)
{
this.Height = LONG_HEIGHT;
btnExpand.Text = "<< Hide Server";
btnExpand.Click -= ExpandHandler;
btnExpand.Click += ShrinkHandler;
}
private void btnShrink_Click(object sender, EventArgs e)
{
this.Height = SHORT_HEIGHT;
btnExpand.Text = "Choose Server >>";
btnExpand.Click -= ShrinkHandler;
btnExpand.Click += ExpandHandler;
}
}
The text change occurs without issue, but on one particular client machine, a Dell M4300 laptop workstation, the height change does not take effect. Has anyone resolved a similar issue, and what was the fix if so?
Upvotes: 4
Views: 6118
Reputation: 4703
My guess: The DPI or system font size is different on that machine and your form's AutoScaleMode is either "Font" or "Dpi", making your form's MinimumSize or MaximumSize prevent the change.
Upvotes: 4
Reputation: 117220
Make sure you do not have one of those AutoScale/Size/Whatever properties set to to true.
Upvotes: 0
Reputation: 75296
Check the display mode for the laptop, and in particular check the aspect-ratio setting. Sometimes laptops do weird things to facilitate the wide, short screen.
Upvotes: 2