G
Ger
My dialogue form (sometimes partly, sometimes as a whole) remains visible
during a fairly long processing job.
The dialogue asks the user to enter some data for the job to follow, and
after OK, should disappear and the processing job (Sub CreateHTML()) starts,
while showing a progress bar in the main form.
The problem is that the dialogue form stays visible and does not close
during execution of the job. It closes after the job is finished.
What am I doing wrong? Should I start a separate thread for the processing
job, or is there a more simple solution I am not aware of yet? Code below:
Dim fh As New frmHTML
If fh.ShowDialog(Me) = DialogResult.OK Then
'save dialogue data:
'(not relevant I think, but left it in for clearity)
DBDirectory = Directory.GetCurrentDirectory
HLang = fh.cmbLanguage.Text
HMainOnly = fh.radMain.Checked
HVarCols = Val(fh.txtCols.Text)
DBDirectory = fh.txtOutput.Text
fh.Dispose() 'Get rid of the dialogue form (I thought......)
' do the processing job:
CreateHTML()
Else
fh.Dispose()
End if
Thank you for replying.
/Ger
during a fairly long processing job.
The dialogue asks the user to enter some data for the job to follow, and
after OK, should disappear and the processing job (Sub CreateHTML()) starts,
while showing a progress bar in the main form.
The problem is that the dialogue form stays visible and does not close
during execution of the job. It closes after the job is finished.
What am I doing wrong? Should I start a separate thread for the processing
job, or is there a more simple solution I am not aware of yet? Code below:
Dim fh As New frmHTML
If fh.ShowDialog(Me) = DialogResult.OK Then
'save dialogue data:
'(not relevant I think, but left it in for clearity)
DBDirectory = Directory.GetCurrentDirectory
HLang = fh.cmbLanguage.Text
HMainOnly = fh.radMain.Checked
HVarCols = Val(fh.txtCols.Text)
DBDirectory = fh.txtOutput.Text
fh.Dispose() 'Get rid of the dialogue form (I thought......)
' do the processing job:
CreateHTML()
Else
fh.Dispose()
End if
Thank you for replying.
/Ger
