J
John
Hi
My app involves an Infragistics control but as problem seems to be more with
how vb.net works when using SUB Main so I am posting it here nevertheless. I
want my app to pick up the first command line argument, pass it to
infragistics desktop alert control to display and then exit. My code is
given below. Problem is that app exits as soon as it is run and desktop
alert does not get time to be displayed. However the same alert displays
fine if I use start-up form (instead of SUB Main) and use a button on form
to run the ShowDesktopAlert SUB.
What is the problem and how can I make it work using SUB Main?
Thanks
Regards
Module modMain
Friend WithEvents dalMain As New Infragistics.Win.Misc.UltraDesktopAlert
Sub Main(ByVal sArgs() As String)
Dim Tel As String = ""
Dim Caption As String = ""
If sArgs.Length > 0 Then
Tel = sArgs(0)
Caption = "Incoming Staff call " & Tel
ShowDesktopAlert(Caption, "Goto contact?")
End If
End Sub
Sub ShowDesktopAlert(ByVal Caption As String, ByVal Msg As String)
dalMain.Show(Caption & ":" & Msg, "Click here to go to contact
record.")
Application.DoEvents()
End Sub
End Module
My app involves an Infragistics control but as problem seems to be more with
how vb.net works when using SUB Main so I am posting it here nevertheless. I
want my app to pick up the first command line argument, pass it to
infragistics desktop alert control to display and then exit. My code is
given below. Problem is that app exits as soon as it is run and desktop
alert does not get time to be displayed. However the same alert displays
fine if I use start-up form (instead of SUB Main) and use a button on form
to run the ShowDesktopAlert SUB.
What is the problem and how can I make it work using SUB Main?
Thanks
Regards
Module modMain
Friend WithEvents dalMain As New Infragistics.Win.Misc.UltraDesktopAlert
Sub Main(ByVal sArgs() As String)
Dim Tel As String = ""
Dim Caption As String = ""
If sArgs.Length > 0 Then
Tel = sArgs(0)
Caption = "Incoming Staff call " & Tel
ShowDesktopAlert(Caption, "Goto contact?")
End If
End Sub
Sub ShowDesktopAlert(ByVal Caption As String, ByVal Msg As String)
dalMain.Show(Caption & ":" & Msg, "Click here to go to contact
record.")
Application.DoEvents()
End Sub
End Module