Hi
I have a little form that has to do a time consuming job, so the correct way to tell the user that the process it's running it's using a progress bar...
So i decided to create a new form with 2 labels and a progress bar, to show over the little window, that show a title the progress and the number of lines already processed.
Everything is working, except the Z order of this form, i can set the form to be top most, but this is not the correct way, so i think that the correct way it's setting the owner of this new form. The only problem it's the cross threaded exceptions.
How can i set the owner of the form without the exceptions?
Should i look to the CheckForIllegalCrossThreadCalls?
vb.net Code:
Dim maxVal As Integer = 30 Dim newForm As New FormProgress() Dim newThr As New Threading.Thread(AddressOf newForm.ShowDialog) newThr.Start() newForm.SetMaxValue(maxVal) 'Set the progress var newForm.SetTitle("Test title...") For i As Integer = 1 To maxVal Threading.Thread.Sleep(500) newForm.SetCurrentValue(i) Next newForm.CloseForm()




Rate People That Helped You
Reply With Quote
