Exactly. If you use a Sub Main (after turning off app
framework) you have to
create all forms.
-----Original Message-----
From: Discussion of writing applications and components
using Visual Basic
.NET [mailto:VBDOTNET DISCUSS.DEVELOP.COM] On Behalf Of Kelly
Baker
Sent: Tuesday, March 28, 2006 4:23 PM
To: VBDOTNET DISCUSS.DEVELOP.COM
Subject: Re: [VBDOTNET] Best way to run pre-form load code
on startup
OK, I guess the first form is just kind of done for you,
since you cannot
start with a Sub Main. Is this correct?
Kelly
-----Original Message-----
From: Discussion of writing applications and components
using Visual Basic
.NET [mailto:VBDOTNET DISCUSS.DEVELOP.COM] On Behalf Of Robert
Lee
Sent: Tuesday, March 28, 2006 3:17 PM
To: VBDOTNET DISCUSS.DEVELOP.COM
Subject: Re: [VBDOTNET] Best way to run pre-form load code
on startup
Kelly,
Although the ability to use a form without first
creating it has
been put back into 2005 (it was not an option in 2002, or
2003), it is
considered proper form to treat a form like any other class
and create it
first.
Rob
-----Original Message-----
From: Discussion of writing applications and components
using Visual Basic
.NET [mailto:VBDOTNET DISCUSS.DEVELOP.COM] On Behalf Of Kelly
Baker
Sent: Tuesday, March 28, 2006 3:55 PM
To: VBDOTNET DISCUSS.DEVELOP.COM
Subject: Re: [VBDOTNET] Best way to run pre-form load code
on startup
Thanks. What about instantiating new forms? Is
instantiation only for all
of the other forms? Or do I need to just load forms
directly, without
instantiating them, which was a big no-no in VB6?
Kelly
-----Original Message-----
From: Discussion of writing applications and components
using Visual Basic
.NET [mailto:VBDOTNET DISCUSS.DEVELOP.COM] On Behalf Of Robert
Lee
Sent: Tuesday, March 28, 2006 2:12 PM
To: VBDOTNET DISCUSS.DEVELOP.COM
Subject: Re: [VBDOTNET] Best way to run pre-form load code
on startup
Kelly,
You can have a sub main, but not if you use the
application
framework ("My" namespace, this is new in 2005).
The "Main" form is created
automatically when it is the start up object, all other
forms will need to
be created.
I have a "StartUp" routine that I call
from within the form_load
event that creates all of my class instances, reads in
settings, starts
logging, etc. (All the stuff I did in ModMain in VB6 and
.NET 2003)
HTH
Rob
-----Original Message-----
From: Discussion of writing applications and components
using Visual Basic
.NET [mailto:VBDOTNET DISCUSS.DEVELOP.COM] On Behalf Of Kelly
Baker
Sent: Tuesday, March 28, 2006 2:26 PM
To: VBDOTNET DISCUSS.DEVELOP.COM
Subject: [VBDOTNET] Best way to run pre-form load code on
startup
I am new to this list and new to .net. I have been using
VB6 for years. I
now have VS 2005.
In VB6, I could set the startup code to be Sub Main in a
module. In Sub
Main, I would always initialize a lot of my hardware
(industrial equipment
and I/O) before loading the first form. I would also
explicitly instantiate
the form objects and set the object to Nothing when I was
done with the
form. I don't see the parallel in .Net. I know forms are
still objects,
but how do instantiate the first one if I can't have a Sub
Main?
What is the best way to initialize hardware on startup? In
the New event of
the startup form?
I have looked through the DotNet SDK and watched some
training videos, but
nothing ever really answered this question. I have more
training videos and
books on the way, but I wanted to get started now.
Thanks in advance for your help,
Kelly
===================================
This list is hosted by DevelopMentorR http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorR http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorR http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|