我正在用 wpf 应用程序编写 c#,但出现此错误
参数计数不匹配
在调用DoDisplay
方法时。我不知道缺少哪个参数?
这是我的代码
public System.Windows.Controls.RichTextBox _displayWindow = new System.Windows.Controls.RichTextBox();
public void DisplayData(messageType type, String msg)
{
_displayWindow.Dispatcher.Invoke(new EventHandler(DoDisplay));
}
public void DoDisplay(object sender, EventArgs e)
{
try {
_displayWindow.Selection.Text = string.Empty;
_displayWindow.AppendText(_msg);
_displayWindow.ScrollToEnd();
}
catch (Exception ex)
{
}
}