Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
29
Reply
object reference cannot set to the instance of object?
Member1
Jul 15 2015 2:35 AM
733
Reply
I have one method called "Appendtxtdata(string value)". in form1.cs and i want to use it in another class abc.cs for write text. i used following code but doesnt work.
Thanku.
in form1.cs.
public void AppendTxtdata(string value)
{
try
{
if (InvokeRequired)
{
this.Invoke(new Action<string>(AppendTxtdata), new object[] { value });
return;
}
txtdata.Text += value;
}
catch { }
}
in abc.cs
public void getdata() // to run server //
{
Form1 f = new Form1();
f.AppendTxtdata("data sent");
}
the getdata method calling in another method and that method is called in form1 in thread.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
29
)
Next Recommended Forum
shopping cart session issue
Is this overriding of Print() Method ?