TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Member1
NA
169
51k
object reference cannot set to the instance of object?
Jul 15 2015 2:35 AM
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.
Reply
Answers (
29
)
shopping cart session issue
Is this overriding of Print() Method ?