首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

[ 新手有关问题 ] 怎么在一个类与外部变量或窗体组件通讯

2012-03-26 
[ 新手问题 ] 如何在一个类与外部变量或窗体组件通讯如题:Form1.cs中有privateSystem.Windows.Forms.TextB

[ 新手问题 ] 如何在一个类与外部变量或窗体组件通讯
如题:
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);


热点排行