Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

What is differ between Application.Run and .ShowDialog() ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alex9128 - 29 Jul 2005 21:45 GMT
Hi All,

I mean if you writing Sub Main in VB you can start you application either
way:

Dim mainfrm As Form1 = New Form1()
mainfrm.ShowDialog()

or just

Application.Run(New Form1())

What is advantage of each way? And how to count how many times user started
application and let do it only once? Looks like Shared property can't do it.

Alex
Herfried K. Wagner [MVP] - 29 Jul 2005 22:47 GMT
"alex9128" <alex9128@hotmail.com> schrieb:
> I mean if you writing Sub Main in VB you can start you application either
> way:
[quoted text clipped - 7 lines]
>
> What is advantage of each way?

In this particular situation 'Application.Run' is semantically correct, but
'ShowDialog' isn't, because the form should not be shown as a dialog.

> And how to count how many times user started
> application and let do it only once?

<URL:http://www.yoda.arachsys.com/csharp/faq/#one.application.instance>

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

hB - 10 Aug 2005 23:25 GMT
Dialog is model window other is modless.
if there are more than one gui forms/windows then it would effect.

"What is advantage of each way? And how to count how many times user
started application"
Perhaps on Application.Exit and Start of app, manipulate this
information in some text file.

---
hB

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.