سلام
یه نظر رو این میتونید بدید؟
http://www.4shared.com/file/TWNIezvc/Q_online.html
توش یه کلاسه:
با این برنامه:
وقتی Button2 رو میزنم خطا میده.
Object reference not set to an instance of an object.
یه نظر رو این میتونید بدید؟
http://www.4shared.com/file/TWNIezvc/Q_online.html
توش یه کلاسه:
کد:
namespace Q
{
class test: Form1
{
public string exp1()
{
return STR[index];
}
}
}
کد:
namespace Q
{
public partial class Form1 : Form
{
public List<string> STR;
public UInt16 index;
private test a;
public Form1()
{
InitializeComponent();
STR = new List<string>();
}
private void button1_Click(object sender, EventArgs e)
{
string t ;
t = textBox1.Text;
STR.Add(t);
MessageBox.Show(STR[index]);
//index++;
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(a.exp1());
}
}
}
Object reference not set to an instance of an object.




دیدگاه