Thread problems with own ApplicationContext,

  • Thread starter Thread starter eskeeske
  • Start date Start date
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
 
Back
Top