csharp System.Windows.Style.Setters类(方法)实例源码

下面列出了csharp System.Windows.Style.Setters 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Window   
Style style = new Style(typeof(ListBoxItem));
style.Setters.Add(new Setter(ListBoxItem.HorizontalContentAlignmentProperty,
     HorizontalAlignment.Stretch));
ListBox lb = new ListBox();
lb.ItemContainerStyle = style;
ListBoxItem lbi1 = new ListBoxItem();
Button btn = new Button();
btn.Content = "Button as styled list box item.";
lbi1.Content = (btn);
lb.Items.Add(lbi1);


问题


面经


文章

微信
公众号

扫码关注公众号