-
October 1st, 2009, 03:06 PM
#1
cross thread problem
I have a cross thread error when i try to run my app. Here's basically how my class files interact with each other:
I have 3 files:
main.cs
gui.cs
control.cs
In control.cs is a function that checks for user input. When i press the L on my keyboard then control.cs see's this and calls a function in main.cs which then calls a function in gui.cs. In gui.cs i try to add a control back onto the main.cs form. But that's where i get the cross thread error.
Like this:
control.cs -> main.cs -> gui.cs
Then inside of gui.cs i have something like:
main.Controls.Add ( myWindow );
Which appearently isn't allowed to do it like that. Anyone any idea what i could try to solve this??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|