110,571
社区成员
发帖
与我相关
我的任务
分享
class Form1:Form
{
A a = new A(); //实例化 类A
private void txtInput_KeyUp(object sender, KeyEventArgs e)
{
//A a = new A(); // 这句放这里也不起效果
a.Ranks();
}
public RichTextBox RichTxtBox
{
get { return this.txtInput; }
set { this.txtInput = value; }
}
public string fileSize
{
get { return this.KB_Size.Text; }
set { this.KB_Size.Text = value; }
}
}
class A
{
Form1 form_1 = new Form1();
public void Ranks()
{
RichTextBox rbox = this.form_1.RichTxtBox;
//代码句...............
form_1.fileSize = string.Format("...");
this.form_1.Text = "XXX";
}
}
class Form1:Form
是窗体的全局类
public partial class Form1:Form
貌似 A a = new A(this); //实例化 类A
不能用 this