bghanim
Active member
Hello All,
I have a thread in my application that tries to load a form and display it, but my problem is that the form appears for a some seconds then disappears. I think this is because of the thread is being killed, right? How can I fix this problem
I have a thread in my application that tries to load a form and display it, but my problem is that the form appears for a some seconds then disappears. I think this is because of the thread is being killed, right? How can I fix this problem
VB.NET:
Dim loadThread As New System.Threading.Thread(AddressOf loadReport)
loadThread.Start()
VB.NET:
Private Sub loadReport()
Dim rpt As New ReportDocument
Try
rpt.Load(Me.repSource)
Catch ex As Exception
MsgBox(ex.Message)
End Try
For i As Integer = 0 To Me.maxParam - 1
Dim paramPattern As New CrystalDecisions.Shared.ParameterValues
Dim paramValue As New CrystalDecisions.Shared.ParameterDiscreteValue
paramValue.Value = Me.paramTextBox(i).Text
paramPattern.Add(paramValue)
rpt.DataDefinition.ParameterFields(Me.paramLbl(i).Text).ApplyCurrentValues(paramPattern)
Next
Dim fr As New userDefRepViewFr
fr.CrystalReportViewer1.ReportSource = rpt
fr.Show()
'Me.Panel1.Visible = False
End Sub