我需要设置边框的左边和宽度。我正在尝试使用保证金
b.Margin = new Thickness(pb.X, b.Margin.Top, b.Margin.Right, b.Margin.Bottom);但是如果我设置了Width属性,边框会被放在一个不正确的奇怪位置...(半屏+我想要的左边的一半)。
我该怎么做这个戏法呢?
谢谢
发布于 2011-03-28 20:32:49
var totalAvailableWidth = ...; // you will have to get it somewhere
var marginRight = totalAvailableWidth - pb.X - width;
b.Margin = new Thickness(pb.X, b.Margin.Top, marginRight, b.Margin.Bottom);https://stackoverflow.com/questions/5458974
复制相似问题