I figured out that if I do this in Form1:
private void Open()
{
Open Open = new Open();
Open.Show();
this.Hide();
}
(And then call it)
public void OpenFile()
{
textBox1.Text = OpenTxt; <-- (string value set in (form)Open)
}
and this in (form)Open:
...
User Profile
Collapse
-
-
Could you show me an example using my code? Or any code at all.
I'm not quite sure I understand what you mean by declaring a form1 object in form2.Leave a comment:
-
C# textbox Object reference problem
Hi. I've got a problem with object references in a second form in the application.
I'll just post the code of both forms.
The error is at the bottom of the post.
First form (With textbox).
...Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO;
No activity results to display
Show More
Leave a comment: