i have this code :
Expand|Select|Wrap|Line Numbers
- //constructor
- public Test()
- {
- InitializeComponent();
- Thread t = new Thread(new ThreadStart(NewForm));
- t.Start();
- }
- public void NewForm()
- {
- Form1 f = new Form1();
- f.MdiParent = this;
- }
Cross-thread operation not valid: Control 'Main' accessed from a thread other than the thread it was created on
how can i solve my problem? it will be easier for me to understand if you give the example with code.
thx