开发者

WPF Set border left and width

I need to set the left and width of a border. I'm trying to use margin

b.Margin = ne开发者_运维问答w Thickness(pb.X, b.Margin.Top, b.Margin.Right, b.Margin.Bottom);

but if I set the Width property the border is placed in an incorrect strange position... (the half screen + half of the left that i want).

how can i do the trick?

thanks


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);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜