C# WPF how to set location,width and height of the controls programmatically?

后端 未结 6 1267
慢半拍i
慢半拍i 2021-01-01 23:14

I\'m doing my first WPF application. im having problem whereby when my form is maximized or fullscreen, my controls wont resize and just stay in the same location. only the

6条回答
  •  误落风尘
    2021-01-01 23:32

    It is possible to programmatically move child elements on a Canvas.

    In xaml:

    
        
    
    

    In C#:

    Canvas.SetTop(YourElement, newX);
    Canvas.SetLeft(YourElement, newY);
    

提交回复
热议问题