Form Freezing
Posted: Thu Aug 04, 2011 4:58 pm
I am trying to launch a simple form with a few buttons on it which I made using designer. I am trying to show the form in a recordings user code using the following code and am having issues.
When I launch the form in this manner it shows up however only half of the data is present in the form and when I click on the form it says it is not responding and crashes. I have read around and thought that there may be a threading issue so I tried the following code but it gave me the same issue.
Has anyone else launched a custom form from within user code? If so how do you do it?
Thanks in advance
Code: Select all
public void AwaitingDataForm()
{
CommonUtilLib.Forms.AwaitingDataForm ADform = new CommonUtilLib.Forms.AwaitingDataForm();
ADform.Show();
}
When I launch the form in this manner it shows up however only half of the data is present in the form and when I click on the form it says it is not responding and crashes. I have read around and thought that there may be a threading issue so I tried the following code but it gave me the same issue.
Code: Select all
public void NewThread()
{
Thread thread = new Thread(new ThreadStart(WorkThreadFunction));
thread.Start();
}
public void WorkThreadFunction()
{
try
{
CommonUtilLib.Forms.AwaitingDataForm ADform = new CommonUtilLib.Forms.AwaitingDataForm();
ADform.Show();
}
catch (Exception ex)
{
}
Has anyone else launched a custom form from within user code? If so how do you do it?
Thanks in advance