How to choose start class?

D

Diego F.

Hello. I have a windows forms application with one form. I added other class
files too. By default, the applications starts in the form class, but I want
it to start from other class. How can I do that?
 
D

Diego F.

Ok, I found it. I can choose it from the project properties page. I had to
uncheck 'Enable application framework' and then I can choose any file as
startup object.
 
R

Robin Tucker

Hi Diego,

Right click the project and choose "properties". On the application tab you
should find a drop-down list to choose which form you want to set as the
startup instance.



Robin
 
C

Cor Ligthert [MVP]

Diego,

Be aware that you only can start from a module or a shared class (which is
in fact a module)

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
Be aware that you only can start from a module or a shared class (which is
in fact a module)

?!?

VB.NET does not support shared classes (and no, I do not consider modules to
be shared classes). However, the 'Main' method can be specified in a class
if the *method* is marked as 'Shared'.
 
C

Cor Ligthert [MVP]

Yes you are right, however this is a newsgroup, not a documentation system.

In this newsgroup I can find plenty of messages, as well from Herfried K.
Wagner, where we talk about a shared class as the members are shared. And
because of the fact that it is impossible to build a class in VB.Net with
non shared public members a lot of us call that a shared class.

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
Yes you are right, however this is a newsgroup, not a documentation
system.

In this newsgroup I can find plenty of messages, as well from Herfried K.
Wagner, where we talk about a shared class as the members are shared. And
because of the fact that it is impossible to build a class in VB.Net with
non shared public members a lot of us call that a shared class.

I feel sorry, but I really do not understand the last sentence. VB.NET does
not support the concept of a shared class for which the compiler enforces
all members to be marked as 'Shared', as it is supported for static classes
in C#.
 
C

Cor Ligthert [MVP]

VB.NET does not support the concept of a shared class for which the
compiler enforces all members to be marked as 'Shared', as it is supported
for static classes in C#.
See my 2 minutes later answered by you answered message too you.

Cor
 

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