window resize when textbox resize

前端 未结 3 1405
心在旅途
心在旅途 2021-01-28 13:12

Here is the code for Textbox available in my window(form1.xaml),My requirement is when i am resizing my window i want to resize the textbox width also, How can i able to achieve

3条回答
  •  星月不相逢
    2021-01-28 14:12

    Layout in WPF is heavily depend on the parent container. For example, create a form with labels and input fields, consider using a Grid panel. Controls in WPF by default resize according to the layout behavior of their parent. Here is an example of a window with two labeled text boxes and two buttons that resize along with the window.

       
          
        
            
            
        
        
            
            
            
        
    
        

提交回复
热议问题