我的问题有点复杂:
我有 Socket 服务器,我有两种形式。一种是服务器的主要形式,另一种是定制的消息框。当请求到达服务器时,主表单必须调用第二个表单(消息框)。当主窗体第一次打开时,一切正常。但是当我关闭主窗体而不关闭应用程序并再次打开它并且请求到达服务器时,定制的消息框打开但它冻结并看起来像这样:
调用代码:
Private Delegate Sub DInvoke(ByRef Frm As Form, ByVal Text As String, ByVal Title As String, ByVal Socket As Integer, ByVal DataX As String, ByVal ReqForProfil As Boolean)
Public Sub ShowMessage(ByRef Frm As Form, ByVal Text As String, ByVal Title As String, ByVal Socket As Integer, ByVal DataX As String, ByVal ReqForProfil As Boolean)
If Frm.InvokeRequired Then
Dim DT As New DInvoke(AddressOf ShowMessage)
Frm.Invoke(DT, New Object() {Frm, Text, Title, Socket, DataX, ReqForProfil})
Else
Messegar = New MessageFrm(Text, Title, Socket, DataX, ReqForProfil, True, 30)
Messegar.Show()
End If
End Sub
任何帮助,将不胜感激!