Thread problems with own ApplicationContext,


Ad

Advertisements

D

Durstin Selfridge

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top