在WinRT背后的代码中更改属性Canvas.Left和Canvas.Top [英] Change propety Canvas.Left and Canvas.Top in codebehind WinRT

查看:81
本文介绍了在WinRT背后的代码中更改属性Canvas.Left和Canvas.Top的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<Button x:Name="PlayButton" Content="Play" Canvas.Left="570" Canvas.Top="36" Height="51" Width="202" Background="#FF8898F9" />

如何在代码中更改PlayButton的Canvas.Top和Canvas.Left属性?

How change Canvas.Top and Canvas.Left property of PlayButton in the code?

推荐答案

Canvas 类具有 SetTop SetLeft 设置这些附加属性的静态方法:

Canvas class has SetTop and SetLeft static methods that set these attached properties:

Canvas.SetTop(PlayButton, 36);
Canvas.SetLeft(PlayButton, 750);

这篇关于在WinRT背后的代码中更改属性Canvas.Left和Canvas.Top的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆