0
我試圖動態創建組合框,但無法創建它。 這是我寫的代碼。動態創建組合框的問題
ComboBox com_dynamic = new ComboBox();
com_dynamic.Height = 50;
com_dynamic.Width = 100;
LayoutRoot.Children.Add(com_dynamic);
tb.Margin = new Thickness(0, 145, 87, 0);
tb.VerticalAlignment = VerticalAlignment.Top;
tb.HorizontalAlignment = HorizontalAlignment.Right;
ComboBoxItem com_dynamic_item = new ComboBoxItem();
com_dynamic.AddChild(com_dynamic_item);
com_dynamic_item.Content = "item1";
哇!一個編輯改變了你的代碼的全部含義! – vaibhav