This is my problem
|
When I close the form and try to reopen it, this error occurs:
Can not access a disposed object.
How I solve can it?
Thanks people
|
When I close the form and try to reopen it, this error occurs:
Can not access a disposed object.
How I solve can it?
Thanks people
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
FroglegPosted Feb 15, 2011, 12:40 AM
Santiago FirezziPosted Feb 15, 2011, 12:29 AM
Modify the code
And look what happens when you add 2 or more rows...
I can repair the problem, so it's done
Thanks a lot for your assistance
Grettings
FroglegPosted Feb 15, 2011, 12:23 AM
Form2 agregardatos closes and then cannot be used again ?
change
agregardatos.Close();
to
agregardatos.Hide();
Santiago FirezziPosted Feb 14, 2011, 11:59 PM
Santiago FirezziPosted Feb 14, 2011, 11:42 PM
In a moments I upload a project with my problem
FroglegPosted Feb 14, 2011, 11:30 PM
Santiago FirezziPosted Feb 14, 2011, 11:13 PM
The UserControl have the datagrid with a DataSet and another things.
I use the XForm to insert a new row in the UserControl.
The data comes from the text boxes in the XForm
FroglegPosted Feb 14, 2011, 11:01 PM
user control and Xform are already open ?
You want Xform textbox.text to be entered into database by clicking button on formX
Santiago FirezziPosted Feb 14, 2011, 10:55 PM
There is only 1 TextBox are like 15 ...
FroglegPosted Feb 14, 2011, 10:47 PM
Santiago FirezziPosted Feb 14, 2011, 10:35 PM
I am working with a database in this UserControl and I need a form to add data.
to that is this
Do you understand me?
FroglegPosted Feb 14, 2011, 10:12 PM
Can you explain why you need to click FormX.button1 from form1
Santiago FirezziPosted Feb 14, 2011, 10:03 PM
I edit the code:
FroglegPosted Feb 14, 2011, 9:56 PM
{
//FormX AddNewForm = new FormX();//1* move to button event
private void button1_Click(object sender, EventArgs e)
{
FormX AddNewForm = new FormX();
AddNewForm.Show();
}
private void button2_Click(object sender, EventArgs e)
{
AddNewForm.Close();//2* or use AddNewForm.Hide()
}
}