PC Review


Reply
Thread Tools Rate Thread

can't show form from sub main

 
 
dennist
Guest
Posts: n/a
 
      10th Aug 2003
Well I can, but it flashes on the screen then closes in
under a second. If I open one form from another, that
doesn't happen. The form stays there, as it should.

Hope somebody can help.

dennist
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      10th Aug 2003
Hello,

"dennist" <(E-Mail Removed)> schrieb:
> Well I can, but it flashes on the screen then closes in
> under a second. If I open one form from another, that
> doesn't happen. The form stays there, as it should.


\\\
Public Sub Main()
Application.Run(New MainForm())
End Sub
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


 
Reply With Quote
 
Ying-Shen Yu
Guest
Posts: n/a
 
      11th Aug 2003
Hello, dennist:
Just as Herfried said, Windows GUI Application runs in an event-driven
model, so there must be a message pipe to get
these messages from system and then dispatch them to the controls in the
form. It's similiar to
while(GetMessage(msg) )
{
ProcessMessage(msg);
DispatchMessage(msg);
}
The static method Application.Run will run the msg loop for you, You
should call Application.Run as Herfried's example, when you creating a new
form, Thanks.


Kind regards,

Ying-Shen Yu [MSFT]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.

From: "Herfried K. Wagner [MVP]" <(E-Mail Removed)>
Subject: Re: can't show form from sub main
Date: Sun, 10 Aug 2003 13:45:05 +0200
Newsgroups: microsoft.public.dotnet.framework.windowsforms

Hello,

"dennist" <(E-Mail Removed)> schrieb:
> Well I can, but it flashes on the screen then closes in
> under a second. If I open one form from another, that
> doesn't happen. The form stays there, as it should.


\\\
Public Sub Main()
Application.Run(New MainForm())
End Sub
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show record on the main form related on the sub form. =?Utf-8?B?QW1pcl9K?= Microsoft Access 2 4th Jul 2007 03:40 PM
Show us only the main form =?Utf-8?B?YW4=?= Microsoft Access 0 11th May 2006 01:53 PM
SP2 - My App does not show main form Neville Lang Microsoft Dot NET Compact Framework 10 9th Mar 2004 06:51 PM
RE: show main form Steve Steiner [MSFT] Microsoft C# .NET 0 10th Jul 2003 10:36 PM
Re: show main form Amco Microsoft C# .NET 1 9th Jul 2003 01:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:59 AM.