C# WinForms Vertical Alignment for TextBox, etc

前端 未结 5 1399
天涯浪人
天涯浪人 2020-12-03 12:34

I\'m working on a project updating their WinForms application UI to be more consistent with sizes. TextBox and ComboBox controls have different heights by default, even wit

5条回答
  •  甜味超标
    2020-12-03 12:43

    Create an empty Control and include your TextBox as a child. Then when the parent Control or the TextBox, resize realign your TextBox control in the middle vertically.

    Remove the borders, make the background the same color as the parent (default). Override the font to set the TextBox font and I think you have will have a vertically aligned TextBox.

提交回复
热议问题