|
-
January 8th, 2010, 02:11 AM
#1
recursive function question
Hello you All;
I have a recursive function which makes the UI freeze in my program.I would like to put this function in another thread however, because there are a lot of control connected with main form, whenever I attempt to run it VC# gives me a cross thread error which is I am dealing with right now.
Also the function uses a structure which is on another class.
I have tried to call my radiobuttons using the code I wrote below, but I am not sure this is the correct way to do this..
Please help me out.. Thanks in advance
[
delegate void SetButtonCallback(RadioButton WhichOne, bool button);
private void SetButton(RadioButton WhichOne, bool button)
{
if (WhichOne.InvokeRequired)
{
SetButtonCallback d = new SetButtonCallback(SetButton);
this.BeginInvoke(d, new object[] { WhichOne, button });
}
else
{
WhichOne.Checked = button;
}
}
]
Tags for this Thread
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
|