当前位置: 代码迷 >> Silverlight >> WPF中怎么通过C#代码修改控件的Margin
  详细解决方案

WPF中怎么通过C#代码修改控件的Margin

热度:9411   发布时间:2013-02-26 00:00:00.0
WPF中如何通过C#代码修改控件的Margin?
RT。我想直接写
UpArea.Margin.Bottom=0;
但是报错说不能修改返回值,因为不是变量。
请教各位这个应该怎么做,谢谢!

------解决方案--------------------------------------------------------
UpArea.Margin.Bottom不能这样写一般都是UpArea.marginBottom或者UpArea.style("marginBottom",0)
------解决方案--------------------------------------------------------
UpArea.Margin = new Thickness(1, 2, 3, 4);


http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.margin(v=vs.95).aspx