You can create forms the normal way. Build a form in design time, and new it
up at run time. For example, suppose you have a form, Form1, and suppose you
have a context menu, mnuOptions, for your system tray app. You can setup the
menu with handlers to display your form, e.g.:
mnuOptions.MenuItems.Add(New MenuItem("Form1", _
New EventHandler(AddressOf ShowForm1)))
mnuOptions.MenuItems.Add(New MenuItem("MessageBox", _
New EventHandler(AddressOf ShowMessageBox)))
Private Sub ShowForm1(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim frm As New Form1
frm.Show()
Catch Ex As Exception
'Handle exception
Throw Ex
End Try
End Sub
Private Sub ShowMessageBox(ByVal sender As Object, ByVal e As EventArgs)
Try
MessageBox.Show("Hello world.")
Catch Ex As Exception
'Handle exception
Throw Ex
End Try
End Sub
--durstin
> If i have a Sys Tray Application, with a ApplicationContext but with no
> main form - How can i then call methods that e.g shows forms ???
[quoted text clipped - 4 lines]
> I found this q about it, but it does not solve my problem because in
> this case there is a main Form :
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.windowsfor
ms/browse_thread/thread/f4c86b98cbd56b1c/e3d2afd4eb047aa6?q=ApplicationContext+I
SynchronizeInvoke&rnum=1#e3d2afd4eb047aa6
> ?? ? ?