共鸣

导航

WPF-学习笔记 动态修改控件Margin的值

举例说明:动态添加一个TextBox到Grid中,并设置它的Margin:
TextBox text = new TextBox();
t_grid.Children.Add(text);
Thickness margin = new Thickness(left, top, right, bottom);
text.Margin = margin;

posted on 2011-12-23 16:59  共鸣  阅读(6820)  评论(0编辑  收藏  举报