开发者

How can I get a button's location on the canvas in WPF?

I have a class that uses System.Windows.Controls.Button. What I want to do is to find the button location on the canvas.

Every开发者_JAVA百科 tutorial out there that i found always uses the commands for WinForms Button class (System.Windows.Forms.Button) that has a location property: bt.Location(Point). I can't change over my buttons so I need to find a way to get the button location with System.Windows.Controls.Button reference. Is there an easy way to do this?


If your button is on a Canvas, you can call Canvas.GetLeft and Canvas.GetTop.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜