M
Michael Maes
Hello,
I know forms aren't thread-safe, but I'm a bit stuck here....
I have an MDI-Application which after 'Login' loads the Data from an SQL Server into DataSets.
Those DataSets are Parented on a "DataForm" which is loaded like this:
If IsNothing(Data) Then
Data = New frmData
MDI.containerData.Controls.Add(Data) (MDI = MDI-Container)
With Data
..Dock = DockStyle.Fill
..Show()
End With
End If
The frmData has
Me.SetTopLevel(False)
.... So it's not an MDI-Child ...
In the Load-Event a Thread (trdData) is created to retreive the Data from the server.
After all the data has been loaded (still trdData) an instance is created of a popup-form to alert the user the Data has been loaded.
Dim pop As popMessage = New popMessage
pop.Show("Message")
As you can see the Show-Method of the Form popMessage has been overloaded (to pass the message to display)
What happens is the popMessage gets displayed for about 0,05 seconds and disappears then.
I think the "Invoke-Method" should be called, but I can 't figure-out how
You might be thinking why I'm not using a msgbox... well the popMessage is like the pop-up Outlook 2003 has (together with the background & fading)
Any suggestions would be more then welcome.
TIA,
Michael
I know forms aren't thread-safe, but I'm a bit stuck here....
I have an MDI-Application which after 'Login' loads the Data from an SQL Server into DataSets.
Those DataSets are Parented on a "DataForm" which is loaded like this:
If IsNothing(Data) Then
Data = New frmData
MDI.containerData.Controls.Add(Data) (MDI = MDI-Container)
With Data
..Dock = DockStyle.Fill
..Show()
End With
End If
The frmData has
Me.SetTopLevel(False)
.... So it's not an MDI-Child ...
In the Load-Event a Thread (trdData) is created to retreive the Data from the server.
After all the data has been loaded (still trdData) an instance is created of a popup-form to alert the user the Data has been loaded.
Dim pop As popMessage = New popMessage
pop.Show("Message")
As you can see the Show-Method of the Form popMessage has been overloaded (to pass the message to display)
What happens is the popMessage gets displayed for about 0,05 seconds and disappears then.
I think the "Invoke-Method" should be called, but I can 't figure-out how
You might be thinking why I'm not using a msgbox... well the popMessage is like the pop-up Outlook 2003 has (together with the background & fading)
Any suggestions would be more then welcome.
TIA,
Michael