主题:C#初学者:如何去除这些命名空间
class PeopleClass
{
public string m_Name;
public string m_Sex;
public string m_Phone;
public PeopleClass(string name, string sex, string phone)
{
m_Name = name;
m_Sex = sex;
m_Phone = phone;
}
public override string ToString()
{
return "name:" + this.m_Name + " sex:" + this.m_Sex + " phone:" + this.m_Phone;
}
}
}
在Form的代码中在ListBox控件中添加 lst1.Items.Add(tmp.ToString());(tmp是PeolpleClass类型的)为什么前面会显示一大串,比如name:System.Windows.Forms.TextBox, Text:abc......
((((System.Windows.Forms.TextBox, Text这些是什么,怎么去掉))))
{
public string m_Name;
public string m_Sex;
public string m_Phone;
public PeopleClass(string name, string sex, string phone)
{
m_Name = name;
m_Sex = sex;
m_Phone = phone;
}
public override string ToString()
{
return "name:" + this.m_Name + " sex:" + this.m_Sex + " phone:" + this.m_Phone;
}
}
}
在Form的代码中在ListBox控件中添加 lst1.Items.Add(tmp.ToString());(tmp是PeolpleClass类型的)为什么前面会显示一大串,比如name:System.Windows.Forms.TextBox, Text:abc......
((((System.Windows.Forms.TextBox, Text这些是什么,怎么去掉))))