Showing a form from within Sub Main. 
Author Message
 Showing a form from within Sub Main.

I have a vb.net program that begins with a sub Main.  The
sub Main launches two threads that handle serial
communications with an attached device and three times
that set refresh intervals for various data coming
to/from the device.  None of this is a problem and runs
with less than 1% cpu utilization.

The problem is when I try to add a form that will be used
to monitor all this.  Currently the form consists of
simply a listbox and MainMenu and a NotifyIcon with a
ContextMenu.

The form shows but does not repaint and soon shows "(Not
Responding)" in the caption.  The NotifyIcon does appear
in the system try and the proper tooltip apears but the
context menu does not.  Neither does double-clicking it.



Thu, 06 Oct 2005 02:21:55 GMT  
 Showing a form from within Sub Main.
Hi Daniel,

Just a thought - launch the window with:
Application.DoEvents()

HTH,

Bernie Yaeger


Quote:
> I have a vb.net program that begins with a sub Main.  The
> sub Main launches two threads that handle serial
> communications with an attached device and three times
> that set refresh intervals for various data coming
> to/from the device.  None of this is a problem and runs
> with less than 1% cpu utilization.

> The problem is when I try to add a form that will be used
> to monitor all this.  Currently the form consists of
> simply a listbox and MainMenu and a NotifyIcon with a
> ContextMenu.

> The form shows but does not repaint and soon shows "(Not
> Responding)" in the caption.  The NotifyIcon does appear
> in the system try and the proper tooltip apears but the
> context menu does not.  Neither does double-clicking it.



Thu, 06 Oct 2005 03:41:22 GMT  
 Showing a form from within Sub Main.
Didja use an Application.Run()?


Quote:
> I have a vb.net program that begins with a sub Main.  The
> sub Main launches two threads that handle serial
> communications with an attached device and three times
> that set refresh intervals for various data coming
> to/from the device.  None of this is a problem and runs
> with less than 1% cpu utilization.

> The problem is when I try to add a form that will be used
> to monitor all this.  Currently the form consists of
> simply a listbox and MainMenu and a NotifyIcon with a
> ContextMenu.

> The form shows but does not repaint and soon shows "(Not
> Responding)" in the caption.  The NotifyIcon does appear
> in the system try and the proper tooltip apears but the
> context menu does not.  Neither does double-clicking it.



Thu, 06 Oct 2005 05:40:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Sub Main(): keep app open after showing form?

2. Problem showing 1st form from sub main.

3. Showing forms from Sub Main()

4. Sub Main which shows form not in TaskBar

5. Sub Main to show form in TaskBar

6. difference in sub main for.show and application.run

7. create main form and Sub Form

8. create Main Form Sub form in VB6

9. How to change caption on a sub from text on main form

10. Invock a dll that has sub Main(), instead of a form as entry point

11. trying to start a form, from a MAIN sub in a module

12. Opening a form from a Mobule Sub Main

 

 
Powered by phpBB® Forum Software