我需要为在后面的代码中创建的ComboBox设计ComboBoxItem风格。这里是我到目前为止的代码如何将控件作为参数传递给委托
ComboBox cbo1 = new ComboBox();
cbo1.IsTextSearchEnabled = true;
cbo1.IsEditable = true;
grid1.Children.Add(cbo1);
cbo1.Dispatcher.BeginInvoke(new StyleComboBoxItemDelegate(ref StyleComboBoxItem(cbo1), System.Windows.Threading.DispatcherPriority.Background);
public delegate void StyleComboBoxItemDelegate(ComboBox cbo_tostyle);
public void StyleComboBoxItem(ComboBox cbo_tostyle)
{
//code to style the comboboxitem;
}
我收到以下错误
1. A ref or out argument must be an assignable variable
2. Method name expected
请有人可以帮我指点,什么我做错了吗?
非常感谢
超酷:),非常感谢。 –