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
Barry Milburn
NA
3
0
C# Transfering text from one form to another....
Mar 23 2010 7:28 PM
I have a problem with some code, the first bit of code works fine the data is populated to the open form "testform" textbox1 from the contents of textbox1 on another form say customers form.
testform
form1 = (
testform
)
Application
.OpenForms[
"testform"
];
form1.Controls[
"textBox1"
].Text =
this
.textBox1.Text;
Yet this code below which populates the same data to another form already open "bulkitemloadrequestform" throws the error "Object reference not set to an instance of the object"
bulkitemloadrequestform
form2 = (
bulkitemloadrequestform
)
Application
.OpenForms[
"bulkitemloadrequestform"
];
form2.Controls[
"textBox5"
].Text =
this
.textBox1.Text;
I can't seem to workout why this problem is occuring?
Help much appreciated.
Reply
Answers (
3
)
Search functionality in Combo box and autofill selected data from combobox to textbox
How to show form2 textbox data in form1 textbox