Sending string from class to Form1
Posted
by Farstucker
on Stack Overflow
See other posts from Stack Overflow
or by Farstucker
Published on 2010-03-25T18:35:08Z
Indexed on
2010/03/25
18:43 UTC
Read the original article
Hit count: 270
Although there are some similar questions I’m having difficulties finding an answer on how to receive data in my form from a class.
I have been trying to read about instantiation and its actually one of the few things that does make sense to me :) but if I were to instantiate my form, would I not have two form objects?
To simplify things, lets say I have a some data in Class1 and I would like to pass a string into a label on Form1. Is it legal to instantiate another form1? When trying to do so it looks like I can then access label1.Text but the label isn’t updating. The only thing I can think of is that the form needs to be redrawn or there is some threading issue that I’m unaware of.
Any insight you could provide would be greatly appreciated.
© Stack Overflow or respective owner