G
Guest
Hi all,
i am currently writing a small application which involves two forms. Form A
is used primarily for display purposes while form B is used to gather user
input via a number of textboxes and numeric updowns.
The situation now is that when the user keys in his/her input to form B and
clicks a "add" button, i need to reflect the new inputs on form A. What i
have done now is to start a new thread on form A to wait for changes to take
place on form B. When user clicks the "add" button, a boolean variable
changes to true and the thread spawned from form A attempts to read the value
and reflect it on a Listview control on form A.
However, the problem i face now is that i get an exception which states that
i am not allowed to access members from another thread, meaning the thread
spawned from form A is not allowed to access the listview control on form A.
Is there anything i can do to go around this problem, or is there any other
methods i can use to reflect inputs from form B on form A.
I am using visual c# by the way... Thanks for any help in advance.
i am currently writing a small application which involves two forms. Form A
is used primarily for display purposes while form B is used to gather user
input via a number of textboxes and numeric updowns.
The situation now is that when the user keys in his/her input to form B and
clicks a "add" button, i need to reflect the new inputs on form A. What i
have done now is to start a new thread on form A to wait for changes to take
place on form B. When user clicks the "add" button, a boolean variable
changes to true and the thread spawned from form A attempts to read the value
and reflect it on a Listview control on form A.
However, the problem i face now is that i get an exception which states that
i am not allowed to access members from another thread, meaning the thread
spawned from form A is not allowed to access the listview control on form A.
Is there anything i can do to go around this problem, or is there any other
methods i can use to reflect inputs from form B on form A.
I am using visual c# by the way... Thanks for any help in advance.