一、设置内容模板如下
二、前端调用(xaml) aaabbb三、代码调用(cs) ComboBox cb = new ComboBox() { Background=Brushes.Red,BorderBrush=Brushes.Blue,BorderThickness=new Thickness(2)}; cb.Items.Add( new TextBox { Text = "aaa" ,Foreground=Brushes.White} ); cb.Items.Add(new TextBox { Text = "bbb", Foreground = Brushes.Green }); cb.SelectedIndex = 0; cb.Template = Resources["ComboBoxTemplate1"] as ControlTemplate;四、效果图如下" _ue_custom_node_="true">
Copyright © 2004-2024 Ynicp.com 版权所有 法律顾问:建纬(昆明)律师事务所 昆明市网翼通科技有限公司 滇ICP备08002592号-4