Answer the question
In order to leave comments, you need to log in
Why is the object created in the class destroyed?
In general, I am writing in the form of c # and I ran into the problem of the program crashing, now I will try to explain.
in the main class of the form I create a link to an object on another form, later I fill in the datagrid in this other form with data from the first
Result r1 = new Result();
public void test()
{
for (int i = 0; i < Convert.ToInt32(timeCreditText.Text.ToString()); i++)
{
try
{
r1.dataGridView1.Rows.Add();
r1.dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString();
}
catch(Exception e)
{
MessageBox.Show("error");
}
}
r1.Show();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question