WPF: Aligning the base line of a Label and its TextBox

前端 未结 5 1762
梦如初夏
梦如初夏 2021-02-03 20:26

Let\'s say I have a simple TextBox next to a Label:


    
        
5条回答
  •  执笔经年
    2021-02-03 20:48

    I know that this is an old answer, but for here's an example for those who seek another way, where you don't need to rely on a fixed textbox width:

    Instead of StackPanel, use a DockPanel and .Dock.

    This proves to be very handy when used inside a Grid.

    
         
         
    
    

提交回复
热议问题