【发布时间】:2015-01-22 20:12:08
【问题描述】:
我正在尝试使用 WinForms 之间的事件在 C# 中编写代码。我想使用 RadioButton 更改 1. 表单和 2. 表单的 RichTextBox 中的颜色文本(RadioButtons 在 2. 表单上),但是当我声明变量时:Color valgtFarge = null; 我收到此错误消息:@987654322 @。我究竟做错了什么?
功能:
private void rtf2_TextChanged(object sender, EventArgs e)
{
Color colorChoice = null;
if (rbtnBlack.Checked)
colorChoice = Color.Black;
//same here for the others RadioButtons
if (myEventHandler != null && rtf2.Text.Length != 0)
{
myEventHandler(this, new Form1EventArgs(rtf2.Text.Substring(rtf2.Text.Length - 1),
colorChoice));
}
}
【问题讨论】:
标签: c# events object radio-button