Winforms: ComboBox height doesn't resize when resolution is changed

时间:2017-12-18 08:26:11

标签: c# winforms combobox

I have a basic combobox in a form. Compared to other controls(Button,label, etc) the height of the combobox doesn't change when the resolution is changed.

SELECT CONVERT(varchar(24),Created) as Created FROM test_table

I have tried the method Scale() to scale all other controls, it works for other controls except for combobox. I also tried manually changing the bound but it didn't work. I also tried change the anchor and dock as well.

  1. Expected result: Combobox height(At 150%)=42
  2. Actual result: Combobox height(At 150%)=28

Would appreciate any help on how to fix this issue.

1 个答案:

答案 0 :(得分:0)

您必须将ComboBox的{​​{3}}属性设置为false

    comboBox1.Location = new Point(250, 33);
    comboBox1.Size = new Size(100, 21);
    comboBox1.Scale(scaleFactor);
    comboBox1.IntegralHeight = false;