读书人

[ 新手有关问题 ] 怎么在一个类与外部

发布时间: 2012-03-26 15:46:55 作者: rapoo

[ 新手问题 ] 如何在一个类与外部变量或窗体组件通讯
如题:
Form1.cs中有
private System.Windows.Forms.TextBox content;
public string url;

我现在新增加了一个类文件T_Msg.cs
public class T_Msg
{
public T_Msg()
{
string temp_a;
如何取得url的值
又如何将temp_a的值传给 content
}
}

新手问题,请指教!谢谢了


[解决办法]
public class T_Msg
{
public T_Msg()
{
string temp_a;
如何取得url的值
又如何将temp_a的值传给 content
}

public private string T_str(string temp_a)
{
return temp_hello;
}
}


在form1中引用
content.Text=T_Msg.T_str(url);


读书人网 >C#

热点推荐