C# WinForms Vertical Alignment for TextBox, etc

前端 未结 5 1398
天涯浪人
天涯浪人 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条回答
  •  猫巷女王i
    2020-12-03 13:04

    A very simple solution is to use a Datagridview with 1 column, 1 row, column and row headers not visible and do DefaultCellStyle.Alignment = MiddleLeft.

    And disable adding/deleting of rows and you have a textbox that perfectly aligns the text.

提交回复
热议问题