Home All Groups Group Topic Archive Search About

Sub Main() refusing to work

Author
10 Apr 2006 11:23 PM
Adam Honek
This is probably the most silly question asked here but I just can't figure
it out.

In VB6 letting Sub Main() be the app's startup directory was real easy under
project properties.

In VB.Net however I don't see such an option, all I see is which form I want
the program to start in.

I've added a Sub Main() into forms, modules, and classes (using the shared
parameter) but I just can't
get project properties to let me choose it as the startup sub. It's always
in some form_load it wants
to startup.

Why?

Adam

Author
10 Apr 2006 9:53 PM
Chris
Adam Honek wrote:
Show quoteHide quote
> This is probably the most silly question asked here but I just can't figure
> it out.
>
> In VB6 letting Sub Main() be the app's startup directory was real easy under
> project properties.
>
> In VB.Net however I don't see such an option, all I see is which form I want
> the program to start in.
>
> I've added a Sub Main() into forms, modules, and classes (using the shared
> parameter) but I just can't
> get project properties to let me choose it as the startup sub. It's always
> in some form_load it wants
> to startup.
>
> Why?
>
> Adam
>
>
Show us the code you use to make the the module sub main.  It should
show up as Main in the drop down.

Chris
Author
11 Apr 2006 12:10 AM
Adam Honek
In a module I did it like this:

Module Module1

Public Sub Main()

End Sub

End Module

Similar in a form or class.

Adam

Show quoteHide quote
"Chris" <no@spam.com> wrote in message
news:ezChkGPXGHA.2376@TK2MSFTNGP03.phx.gbl...
> Adam Honek wrote:
>> This is probably the most silly question asked here but I just can't
>> figure it out.
>>
>> In VB6 letting Sub Main() be the app's startup directory was real easy
>> under project properties.
>>
>> In VB.Net however I don't see such an option, all I see is which form I
>> want the program to start in.
>>
>> I've added a Sub Main() into forms, modules, and classes (using the
>> shared parameter) but I just can't
>> get project properties to let me choose it as the startup sub. It's
>> always in some form_load it wants
>> to startup.
>>
>> Why?
>>
>> Adam
> Show us the code you use to make the the module sub main.  It should show
> up as Main in the drop down.
>
> Chris
Author
10 Apr 2006 11:09 PM
Al
In Project Properties there is a check box Enable Application Framework. If
it's checked then there is no Sub main option. If you uncheck it then Sub
Main option appears in the list of startup objects.
You create Sub Main in a module and it works. At least I did what I
described.

Al

Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
> This is probably the most silly question asked here but I just can't
> figure it out.
>
> In VB6 letting Sub Main() be the app's startup directory was real easy
> under project properties.
>
> In VB.Net however I don't see such an option, all I see is which form I
> want the program to start in.
>
> I've added a Sub Main() into forms, modules, and classes (using the shared
> parameter) but I just can't
> get project properties to let me choose it as the startup sub. It's always
> in some form_load it wants
> to startup.
>
> Why?
>
> Adam
>
Author
11 Apr 2006 12:27 AM
Adam Honek
It doesn't like it when I turn off the framework option.

Just loads the form and then exits the program.

Public Sub Main()

Dim NewInstance = New frmMain

NewInstance.show()

End Sub



Show quoteHide quote
"Al" <a*@newsgroups.com> wrote in message
news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
> In Project Properties there is a check box Enable Application Framework.
> If it's checked then there is no Sub main option. If you uncheck it then
> Sub Main option appears in the list of startup objects.
> You create Sub Main in a module and it works. At least I did what I
> described.
>
> Al
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>> This is probably the most silly question asked here but I just can't
>> figure it out.
>>
>> In VB6 letting Sub Main() be the app's startup directory was real easy
>> under project properties.
>>
>> In VB.Net however I don't see such an option, all I see is which form I
>> want the program to start in.
>>
>> I've added a Sub Main() into forms, modules, and classes (using the
>> shared parameter) but I just can't
>> get project properties to let me choose it as the startup sub. It's
>> always in some form_load it wants
>> to startup.
>>
>> Why?
>>
>> Adam
>>
>
>
Author
10 Apr 2006 10:57 PM
Chris
Adam Honek wrote:
Show quoteHide quote
> It doesn't like it when I turn off the framework option.
>
> Just loads the form and then exits the program.
>
> Public Sub Main()
>
> Dim NewInstance = New frmMain
>
> NewInstance.show()
>
> End Sub
>
>
>
> "Al" <a*@newsgroups.com> wrote in message
> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>
>>In Project Properties there is a check box Enable Application Framework.
>>If it's checked then there is no Sub main option. If you uncheck it then
>>Sub Main option appears in the list of startup objects.
>>You create Sub Main in a module and it works. At least I did what I
>>described.
>>
>>Al
>>
>>"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>
>>>This is probably the most silly question asked here but I just can't
>>>figure it out.
>>>
>>>In VB6 letting Sub Main() be the app's startup directory was real easy
>>>under project properties.
>>>
>>>In VB.Net however I don't see such an option, all I see is which form I
>>>want the program to start in.
>>>
>>>I've added a Sub Main() into forms, modules, and classes (using the
>>>shared parameter) but I just can't
>>>get project properties to let me choose it as the startup sub. It's
>>>always in some form_load it wants
>>>to startup.
>>>
>>>Why?
>>>
>>>Adam
>>>
>>
>>
>
>

do ShowDialog not Show

Chris
Author
11 Apr 2006 1:17 AM
Adam Honek
Thanks, that made it startup without crashing.

Disabling the framework seems to take away functionality within the
controls.

For example the icons I used in the tree view control suddently get a black
border thus look ugly. Turn on the framekwork and bingo they're nice again.

I think it's to do with disabling Windows XP visual styles.

Adam

Show quoteHide quote
"Chris" <no@spam.com> wrote in message
news:eoP9VqPXGHA.3440@TK2MSFTNGP02.phx.gbl...
> Adam Honek wrote:
>> It doesn't like it when I turn off the framework option.
>>
>> Just loads the form and then exits the program.
>>
>> Public Sub Main()
>>
>> Dim NewInstance = New frmMain
>>
>> NewInstance.show()
>>
>> End Sub
>>
>>
>>
>> "Al" <a*@newsgroups.com> wrote in message
>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>
>>>In Project Properties there is a check box Enable Application Framework.
>>>If it's checked then there is no Sub main option. If you uncheck it then
>>>Sub Main option appears in the list of startup objects.
>>>You create Sub Main in a module and it works. At least I did what I
>>>described.
>>>
>>>Al
>>>
>>>"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>>news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>
>>>>This is probably the most silly question asked here but I just can't
>>>>figure it out.
>>>>
>>>>In VB6 letting Sub Main() be the app's startup directory was real easy
>>>>under project properties.
>>>>
>>>>In VB.Net however I don't see such an option, all I see is which form I
>>>>want the program to start in.
>>>>
>>>>I've added a Sub Main() into forms, modules, and classes (using the
>>>>shared parameter) but I just can't
>>>>get project properties to let me choose it as the startup sub. It's
>>>>always in some form_load it wants
>>>>to startup.
>>>>
>>>>Why?
>>>>
>>>>Adam
>>>>
>>>
>>>
>>
>>
>
> do ShowDialog not Show
>
> Chris
Author
11 Apr 2006 12:30 PM
zacks
Try adding:

Application.EnableVisualStyles

in your subMain module.
Author
11 Apr 2006 12:16 AM
Al
I have Sub Main in a module:
Sub Main()

objConn = New SqlConnection

'objConn.ConnectionString = "Data Source=DELLNEW;Initial Catalog=SRSNew;User
ID=administrator;Password=developer4242;"

objConn.ConnectionString = "Data Source=DELL205;Initial
Catalog=SRSNew;Integrated Security=True"

objConn.Open()

Application.Run(New MDIMain)

End Sub

I open SQL Connection and start MDI form. Everything works fine.
You are trying to show the form, not to start the application. This is the
reason why it doesn't work I think.

Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
> It doesn't like it when I turn off the framework option.
>
> Just loads the form and then exits the program.
>
> Public Sub Main()
>
> Dim NewInstance = New frmMain
>
> NewInstance.show()
>
> End Sub
>
>
>
> "Al" <a*@newsgroups.com> wrote in message
> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>> In Project Properties there is a check box Enable Application Framework.
>> If it's checked then there is no Sub main option. If you uncheck it then
>> Sub Main option appears in the list of startup objects.
>> You create Sub Main in a module and it works. At least I did what I
>> described.
>>
>> Al
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>> This is probably the most silly question asked here but I just can't
>>> figure it out.
>>>
>>> In VB6 letting Sub Main() be the app's startup directory was real easy
>>> under project properties.
>>>
>>> In VB.Net however I don't see such an option, all I see is which form I
>>> want the program to start in.
>>>
>>> I've added a Sub Main() into forms, modules, and classes (using the
>>> shared parameter) but I just can't
>>> get project properties to let me choose it as the startup sub. It's
>>> always in some form_load it wants
>>> to startup.
>>>
>>> Why?
>>>
>>> Adam
>>>
>>
>>
>
>
Author
11 Apr 2006 1:22 AM
Adam Honek
If I do what Chris stated and turn off the framework things go ugly in terms
of visuals.

But I then can use Sub Main().

Is the it then true that MS stopped allowing Sub Main() even when the
framework is turned off? Surely they can't mean
to imply professional coding has the app starting in a form right under
form_load or form_activate?

Adam

Show quoteHide quote
"Al" <a*@newsgroups.com> wrote in message
news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>I have Sub Main in a module:
> Sub Main()
>
> objConn = New SqlConnection
>
> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>
> objConn.ConnectionString = "Data Source=DELL205;Initial
> Catalog=SRSNew;Integrated Security=True"
>
> objConn.Open()
>
> Application.Run(New MDIMain)
>
> End Sub
>
> I open SQL Connection and start MDI form. Everything works fine.
> You are trying to show the form, not to start the application. This is the
> reason why it doesn't work I think.
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>> It doesn't like it when I turn off the framework option.
>>
>> Just loads the form and then exits the program.
>>
>> Public Sub Main()
>>
>> Dim NewInstance = New frmMain
>>
>> NewInstance.show()
>>
>> End Sub
>>
>>
>>
>> "Al" <a*@newsgroups.com> wrote in message
>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>> In Project Properties there is a check box Enable Application Framework.
>>> If it's checked then there is no Sub main option. If you uncheck it then
>>> Sub Main option appears in the list of startup objects.
>>> You create Sub Main in a module and it works. At least I did what I
>>> described.
>>>
>>> Al
>>>
>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>> This is probably the most silly question asked here but I just can't
>>>> figure it out.
>>>>
>>>> In VB6 letting Sub Main() be the app's startup directory was real easy
>>>> under project properties.
>>>>
>>>> In VB.Net however I don't see such an option, all I see is which form I
>>>> want the program to start in.
>>>>
>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>> shared parameter) but I just can't
>>>> get project properties to let me choose it as the startup sub. It's
>>>> always in some form_load it wants
>>>> to startup.
>>>>
>>>> Why?
>>>>
>>>> Adam
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Apr 2006 1:06 AM
Al
Adam,
I have a very long experience with VB6, with VB2005 I'm just starting. I did
already several nice looking forms with Infragistics and did not notice any
visual problem.
I cannot be sure that turning on or off Enable Application Framework may
affect visual stuff. Maybe it's related somehow, but as I said I do not see
problems yet.
I attached a couple of screen shots if you are interested to see the
graphics (one with this message and another one with the next message - they
are big for one message). These screens is just a beginning, so do not pay
attention on
labels and the same icons. It's too far from to be finished.
Just to show that I have no prolem with graphics.

Al


Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
> If I do what Chris stated and turn off the framework things go ugly in
> terms
> of visuals.
>
> But I then can use Sub Main().
>
> Is the it then true that MS stopped allowing Sub Main() even when the
> framework is turned off? Surely they can't mean
> to imply professional coding has the app starting in a form right under
> form_load or form_activate?
>
> Adam
>
> "Al" <a*@newsgroups.com> wrote in message
> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>I have Sub Main in a module:
>> Sub Main()
>>
>> objConn = New SqlConnection
>>
>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>
>> objConn.ConnectionString = "Data Source=DELL205;Initial
>> Catalog=SRSNew;Integrated Security=True"
>>
>> objConn.Open()
>>
>> Application.Run(New MDIMain)
>>
>> End Sub
>>
>> I open SQL Connection and start MDI form. Everything works fine.
>> You are trying to show the form, not to start the application. This is
>> the
>> reason why it doesn't work I think.
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>> It doesn't like it when I turn off the framework option.
>>>
>>> Just loads the form and then exits the program.
>>>
>>> Public Sub Main()
>>>
>>> Dim NewInstance = New frmMain
>>>
>>> NewInstance.show()
>>>
>>> End Sub
>>>
>>>
>>>
>>> "Al" <a*@newsgroups.com> wrote in message
>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>> In Project Properties there is a check box Enable Application
>>>> Framework.
>>>> If it's checked then there is no Sub main option. If you uncheck it
>>>> then
>>>> Sub Main option appears in the list of startup objects.
>>>> You create Sub Main in a module and it works. At least I did what I
>>>> described.
>>>>
>>>> Al
>>>>
>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>>> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>> This is probably the most silly question asked here but I just can't
>>>>> figure it out.
>>>>>
>>>>> In VB6 letting Sub Main() be the app's startup directory was real easy
>>>>> under project properties.
>>>>>
>>>>> In VB.Net however I don't see such an option, all I see is which form
>>>>> I
>>>>> want the program to start in.
>>>>>
>>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>>> shared parameter) but I just can't
>>>>> get project properties to let me choose it as the startup sub. It's
>>>>> always in some form_load it wants
>>>>> to startup.
>>>>>
>>>>> Why?
>>>>>
>>>>> Adam
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

[attached file: 3B.jpg]
Author
11 Apr 2006 1:09 AM
Al
Adam,
I have a very long experience with VB6, with VB2005 I'm just starting. I did
already several nice looking forms with Infragistics and did not notice any
visual problem.
I cannot be sure that turning on or off Enable Application Framework may
affect visual stuff. Maybe it's related somehow, but as I said I do not see
problems yet.
I tried to attached a couple of screen shots , but they are not accepted by
the server (sizes 50 K and 90 K - to make them smaller to make them look
worse).

Al


Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
> If I do what Chris stated and turn off the framework things go ugly in
> terms of visuals.
>
> But I then can use Sub Main().
>
> Is the it then true that MS stopped allowing Sub Main() even when the
> framework is turned off? Surely they can't mean
> to imply professional coding has the app starting in a form right under
> form_load or form_activate?
>
> Adam
>
> "Al" <a*@newsgroups.com> wrote in message
> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>I have Sub Main in a module:
>> Sub Main()
>>
>> objConn = New SqlConnection
>>
>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>
>> objConn.ConnectionString = "Data Source=DELL205;Initial
>> Catalog=SRSNew;Integrated Security=True"
>>
>> objConn.Open()
>>
>> Application.Run(New MDIMain)
>>
>> End Sub
>>
>> I open SQL Connection and start MDI form. Everything works fine.
>> You are trying to show the form, not to start the application. This is
>> the reason why it doesn't work I think.
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>> It doesn't like it when I turn off the framework option.
>>>
>>> Just loads the form and then exits the program.
>>>
>>> Public Sub Main()
>>>
>>> Dim NewInstance = New frmMain
>>>
>>> NewInstance.show()
>>>
>>> End Sub
>>>
>>>
>>>
>>> "Al" <a*@newsgroups.com> wrote in message
>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>> In Project Properties there is a check box Enable Application
>>>> Framework. If it's checked then there is no Sub main option. If you
>>>> uncheck it then Sub Main option appears in the list of startup objects.
>>>> You create Sub Main in a module and it works. At least I did what I
>>>> described.
>>>>
>>>> Al
>>>>
>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>>> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>> This is probably the most silly question asked here but I just can't
>>>>> figure it out.
>>>>>
>>>>> In VB6 letting Sub Main() be the app's startup directory was real easy
>>>>> under project properties.
>>>>>
>>>>> In VB.Net however I don't see such an option, all I see is which form
>>>>> I want the program to start in.
>>>>>
>>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>>> shared parameter) but I just can't
>>>>> get project properties to let me choose it as the startup sub. It's
>>>>> always in some form_load it wants
>>>>> to startup.
>>>>>
>>>>> Why?
>>>>>
>>>>> Adam
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Apr 2006 2:18 AM
Adam Honek
Those are nice looking screens indeed.

In that case it must not affect all controls (the visuals going downhill)
because on mine I have a menu strip
and tree view amongst other graphical control and both suffered visual loss
when turning off the framework.

On one side .NET seems easier than VB6 but on the other there's many places
to just ask ?????'s
about even simple things.

At least we can still use the Win32API if unsure and I'm sure it's faster
than this freamework wrapper
interpreted code anyway.

Adam


Show quoteHide quote
"Al" <a*@newsgroups.com> wrote in message
news:eXfkISQXGHA.1192@TK2MSFTNGP03.phx.gbl...
> Adam,
> I have a very long experience with VB6, with VB2005 I'm just starting. I
> did
> already several nice looking forms with Infragistics and did not notice
> any
> visual problem.
> I cannot be sure that turning on or off Enable Application Framework may
> affect visual stuff. Maybe it's related somehow, but as I said I do not
> see
> problems yet.
> I tried to attached a couple of screen shots , but they are not accepted
> by the server (sizes 50 K and 90 K - to make them smaller to make them
> look worse).
>
> Al
>
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
> news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
>> If I do what Chris stated and turn off the framework things go ugly in
>> terms of visuals.
>>
>> But I then can use Sub Main().
>>
>> Is the it then true that MS stopped allowing Sub Main() even when the
>> framework is turned off? Surely they can't mean
>> to imply professional coding has the app starting in a form right under
>> form_load or form_activate?
>>
>> Adam
>>
>> "Al" <a*@newsgroups.com> wrote in message
>> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>>I have Sub Main in a module:
>>> Sub Main()
>>>
>>> objConn = New SqlConnection
>>>
>>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>>
>>> objConn.ConnectionString = "Data Source=DELL205;Initial
>>> Catalog=SRSNew;Integrated Security=True"
>>>
>>> objConn.Open()
>>>
>>> Application.Run(New MDIMain)
>>>
>>> End Sub
>>>
>>> I open SQL Connection and start MDI form. Everything works fine.
>>> You are trying to show the form, not to start the application. This is
>>> the reason why it doesn't work I think.
>>>
>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>>> It doesn't like it when I turn off the framework option.
>>>>
>>>> Just loads the form and then exits the program.
>>>>
>>>> Public Sub Main()
>>>>
>>>> Dim NewInstance = New frmMain
>>>>
>>>> NewInstance.show()
>>>>
>>>> End Sub
>>>>
>>>>
>>>>
>>>> "Al" <a*@newsgroups.com> wrote in message
>>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>>> In Project Properties there is a check box Enable Application
>>>>> Framework. If it's checked then there is no Sub main option. If you
>>>>> uncheck it then Sub Main option appears in the list of startup
>>>>> objects.
>>>>> You create Sub Main in a module and it works. At least I did what I
>>>>> described.
>>>>>
>>>>> Al
>>>>>
>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>> message news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>>> This is probably the most silly question asked here but I just can't
>>>>>> figure it out.
>>>>>>
>>>>>> In VB6 letting Sub Main() be the app's startup directory was real
>>>>>> easy under project properties.
>>>>>>
>>>>>> In VB.Net however I don't see such an option, all I see is which form
>>>>>> I want the program to start in.
>>>>>>
>>>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>>>> shared parameter) but I just can't
>>>>>> get project properties to let me choose it as the startup sub. It's
>>>>>> always in some form_load it wants
>>>>>> to startup.
>>>>>>
>>>>>> Why?
>>>>>>
>>>>>> Adam
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Apr 2006 1:42 AM
Al
I hate XP style myself and even did not try to run under XP desktop
settings. After your answer I tryed and saw that many controls changed their
appearance, but they still look fine. Just different than they are under
Classic settings. Now I need to check all controls, because my users tastes
are not the same as mine, so they may use XP settings. So far I did not find
any problem.

Al

Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:OMt7RXQXGHA.1352@TK2MSFTNGP05.phx.gbl...
> Those are nice looking screens indeed.
>
> In that case it must not affect all controls (the visuals going downhill)
> because on mine I have a menu strip
> and tree view amongst other graphical control and both suffered visual
> loss when turning off the framework.
>
> On one side .NET seems easier than VB6 but on the other there's many
> places to just ask ?????'s
> about even simple things.
>
> At least we can still use the Win32API if unsure and I'm sure it's faster
> than this freamework wrapper
> interpreted code anyway.
>
> Adam
>
>
> "Al" <a*@newsgroups.com> wrote in message
> news:eXfkISQXGHA.1192@TK2MSFTNGP03.phx.gbl...
>> Adam,
>> I have a very long experience with VB6, with VB2005 I'm just starting. I
>> did
>> already several nice looking forms with Infragistics and did not notice
>> any
>> visual problem.
>> I cannot be sure that turning on or off Enable Application Framework may
>> affect visual stuff. Maybe it's related somehow, but as I said I do not
>> see
>> problems yet.
>> I tried to attached a couple of screen shots , but they are not accepted
>> by the server (sizes 50 K and 90 K - to make them smaller to make them
>> look worse).
>>
>> Al
>>
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
>>> If I do what Chris stated and turn off the framework things go ugly in
>>> terms of visuals.
>>>
>>> But I then can use Sub Main().
>>>
>>> Is the it then true that MS stopped allowing Sub Main() even when the
>>> framework is turned off? Surely they can't mean
>>> to imply professional coding has the app starting in a form right under
>>> form_load or form_activate?
>>>
>>> Adam
>>>
>>> "Al" <a*@newsgroups.com> wrote in message
>>> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>>>I have Sub Main in a module:
>>>> Sub Main()
>>>>
>>>> objConn = New SqlConnection
>>>>
>>>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>>>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>>>
>>>> objConn.ConnectionString = "Data Source=DELL205;Initial
>>>> Catalog=SRSNew;Integrated Security=True"
>>>>
>>>> objConn.Open()
>>>>
>>>> Application.Run(New MDIMain)
>>>>
>>>> End Sub
>>>>
>>>> I open SQL Connection and start MDI form. Everything works fine.
>>>> You are trying to show the form, not to start the application. This is
>>>> the reason why it doesn't work I think.
>>>>
>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>>>> It doesn't like it when I turn off the framework option.
>>>>>
>>>>> Just loads the form and then exits the program.
>>>>>
>>>>> Public Sub Main()
>>>>>
>>>>> Dim NewInstance = New frmMain
>>>>>
>>>>> NewInstance.show()
>>>>>
>>>>> End Sub
>>>>>
>>>>>
>>>>>
>>>>> "Al" <a*@newsgroups.com> wrote in message
>>>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>>>> In Project Properties there is a check box Enable Application
>>>>>> Framework. If it's checked then there is no Sub main option. If you
>>>>>> uncheck it then Sub Main option appears in the list of startup
>>>>>> objects.
>>>>>> You create Sub Main in a module and it works. At least I did what I
>>>>>> described.
>>>>>>
>>>>>> Al
>>>>>>
>>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>>> message news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>>>> This is probably the most silly question asked here but I just can't
>>>>>>> figure it out.
>>>>>>>
>>>>>>> In VB6 letting Sub Main() be the app's startup directory was real
>>>>>>> easy under project properties.
>>>>>>>
>>>>>>> In VB.Net however I don't see such an option, all I see is which
>>>>>>> form I want the program to start in.
>>>>>>>
>>>>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>>>>> shared parameter) but I just can't
>>>>>>> get project properties to let me choose it as the startup sub. It's
>>>>>>> always in some form_load it wants
>>>>>>> to startup.
>>>>>>>
>>>>>>> Why?
>>>>>>>
>>>>>>> Adam
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Apr 2006 1:48 AM
Al
Adam,
I use MenuStrip too, but it looks the same under both settings. I couldn't
mak a screen shot of it.
I did a small image from another couple of controls - Tab and Grid. See
attached.

Al

Show quoteHide quote
"Al" <a*@newsgroups.com> wrote in message
news:%23uzw7kQXGHA.2376@TK2MSFTNGP03.phx.gbl...
>I hate XP style myself and even did not try to run under XP desktop
> settings. After your answer I tryed and saw that many controls changed
> their
> appearance, but they still look fine. Just different than they are under
> Classic settings. Now I need to check all controls, because my users
> tastes
> are not the same as mine, so they may use XP settings. So far I did not
> find
> any problem.
>
> Al
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
> news:OMt7RXQXGHA.1352@TK2MSFTNGP05.phx.gbl...
>> Those are nice looking screens indeed.
>>
>> In that case it must not affect all controls (the visuals going downhill)
>> because on mine I have a menu strip
>> and tree view amongst other graphical control and both suffered visual
>> loss when turning off the framework.
>>
>> On one side .NET seems easier than VB6 but on the other there's many
>> places to just ask ?????'s
>> about even simple things.
>>
>> At least we can still use the Win32API if unsure and I'm sure it's faster
>> than this freamework wrapper
>> interpreted code anyway.
>>
>> Adam
>>
>>
>> "Al" <a*@newsgroups.com> wrote in message
>> news:eXfkISQXGHA.1192@TK2MSFTNGP03.phx.gbl...
>>> Adam,
>>> I have a very long experience with VB6, with VB2005 I'm just starting. I
>>> did
>>> already several nice looking forms with Infragistics and did not notice
>>> any
>>> visual problem.
>>> I cannot be sure that turning on or off Enable Application Framework may
>>> affect visual stuff. Maybe it's related somehow, but as I said I do not
>>> see
>>> problems yet.
>>> I tried to attached a couple of screen shots , but they are not accepted
>>> by the server (sizes 50 K and 90 K - to make them smaller to make them
>>> look worse).
>>>
>>> Al
>>>
>>>
>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>> news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
>>>> If I do what Chris stated and turn off the framework things go ugly in
>>>> terms of visuals.
>>>>
>>>> But I then can use Sub Main().
>>>>
>>>> Is the it then true that MS stopped allowing Sub Main() even when the
>>>> framework is turned off? Surely they can't mean
>>>> to imply professional coding has the app starting in a form right under
>>>> form_load or form_activate?
>>>>
>>>> Adam
>>>>
>>>> "Al" <a*@newsgroups.com> wrote in message
>>>> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>>>>I have Sub Main in a module:
>>>>> Sub Main()
>>>>>
>>>>> objConn = New SqlConnection
>>>>>
>>>>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>>>>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>>>>
>>>>> objConn.ConnectionString = "Data Source=DELL205;Initial
>>>>> Catalog=SRSNew;Integrated Security=True"
>>>>>
>>>>> objConn.Open()
>>>>>
>>>>> Application.Run(New MDIMain)
>>>>>
>>>>> End Sub
>>>>>
>>>>> I open SQL Connection and start MDI form. Everything works fine.
>>>>> You are trying to show the form, not to start the application. This is
>>>>> the reason why it doesn't work I think.
>>>>>
>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>> message
>>>>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>>>>> It doesn't like it when I turn off the framework option.
>>>>>>
>>>>>> Just loads the form and then exits the program.
>>>>>>
>>>>>> Public Sub Main()
>>>>>>
>>>>>> Dim NewInstance = New frmMain
>>>>>>
>>>>>> NewInstance.show()
>>>>>>
>>>>>> End Sub
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Al" <a*@newsgroups.com> wrote in message
>>>>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>>>>> In Project Properties there is a check box Enable Application
>>>>>>> Framework. If it's checked then there is no Sub main option. If you
>>>>>>> uncheck it then Sub Main option appears in the list of startup
>>>>>>> objects.
>>>>>>> You create Sub Main in a module and it works. At least I did what I
>>>>>>> described.
>>>>>>>
>>>>>>> Al
>>>>>>>
>>>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>>>> message news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>>>>> This is probably the most silly question asked here but I just
>>>>>>>> can't
>>>>>>>> figure it out.
>>>>>>>>
>>>>>>>> In VB6 letting Sub Main() be the app's startup directory was real
>>>>>>>> easy under project properties.
>>>>>>>>
>>>>>>>> In VB.Net however I don't see such an option, all I see is which
>>>>>>>> form I want the program to start in.
>>>>>>>>
>>>>>>>> I've added a Sub Main() into forms, modules, and classes (using the
>>>>>>>> shared parameter) but I just can't
>>>>>>>> get project properties to let me choose it as the startup sub. It's
>>>>>>>> always in some form_load it wants
>>>>>>>> to startup.
>>>>>>>>
>>>>>>>> Why?
>>>>>>>>
>>>>>>>> Adam
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

[attached file: 5.jpg]
Author
12 Apr 2006 1:41 AM
Adam Honek
I think it must be because the images you're using aren't 32bit hence you
can't
tell the difference in quality.

Even 24bit isn't 32bit quality because of the alpha 8 bit channel despite
both being 16.7m colours.

Adam

Show quoteHide quote
"Al" <a*@newsgroups.com> wrote in message
news:OwzgRoQXGHA.3808@TK2MSFTNGP04.phx.gbl...
> Adam,
> I use MenuStrip too, but it looks the same under both settings. I couldn't
> mak a screen shot of it.
> I did a small image from another couple of controls - Tab and Grid. See
> attached.
>
> Al
>
> "Al" <a*@newsgroups.com> wrote in message
> news:%23uzw7kQXGHA.2376@TK2MSFTNGP03.phx.gbl...
>>I hate XP style myself and even did not try to run under XP desktop
>> settings. After your answer I tryed and saw that many controls changed
>> their
>> appearance, but they still look fine. Just different than they are under
>> Classic settings. Now I need to check all controls, because my users
>> tastes
>> are not the same as mine, so they may use XP settings. So far I did not
>> find
>> any problem.
>>
>> Al
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:OMt7RXQXGHA.1352@TK2MSFTNGP05.phx.gbl...
>>> Those are nice looking screens indeed.
>>>
>>> In that case it must not affect all controls (the visuals going
>>> downhill)
>>> because on mine I have a menu strip
>>> and tree view amongst other graphical control and both suffered visual
>>> loss when turning off the framework.
>>>
>>> On one side .NET seems easier than VB6 but on the other there's many
>>> places to just ask ?????'s
>>> about even simple things.
>>>
>>> At least we can still use the Win32API if unsure and I'm sure it's
>>> faster
>>> than this freamework wrapper
>>> interpreted code anyway.
>>>
>>> Adam
>>>
>>>
>>> "Al" <a*@newsgroups.com> wrote in message
>>> news:eXfkISQXGHA.1192@TK2MSFTNGP03.phx.gbl...
>>>> Adam,
>>>> I have a very long experience with VB6, with VB2005 I'm just starting.
>>>> I
>>>> did
>>>> already several nice looking forms with Infragistics and did not notice
>>>> any
>>>> visual problem.
>>>> I cannot be sure that turning on or off Enable Application Framework
>>>> may
>>>> affect visual stuff. Maybe it's related somehow, but as I said I do not
>>>> see
>>>> problems yet.
>>>> I tried to attached a couple of screen shots , but they are not
>>>> accepted
>>>> by the server (sizes 50 K and 90 K - to make them smaller to make them
>>>> look worse).
>>>>
>>>> Al
>>>>
>>>>
>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>>>> news:%23mnmT4PXGHA.4652@TK2MSFTNGP04.phx.gbl...
>>>>> If I do what Chris stated and turn off the framework things go ugly in
>>>>> terms of visuals.
>>>>>
>>>>> But I then can use Sub Main().
>>>>>
>>>>> Is the it then true that MS stopped allowing Sub Main() even when the
>>>>> framework is turned off? Surely they can't mean
>>>>> to imply professional coding has the app starting in a form right
>>>>> under
>>>>> form_load or form_activate?
>>>>>
>>>>> Adam
>>>>>
>>>>> "Al" <a*@newsgroups.com> wrote in message
>>>>> news:uK15h0PXGHA.1200@TK2MSFTNGP03.phx.gbl...
>>>>>>I have Sub Main in a module:
>>>>>> Sub Main()
>>>>>>
>>>>>> objConn = New SqlConnection
>>>>>>
>>>>>> 'objConn.ConnectionString = "Data Source=DELLNEW;Initial
>>>>>> Catalog=SRSNew;User ID=administrator;Password=developer4242;"
>>>>>>
>>>>>> objConn.ConnectionString = "Data Source=DELL205;Initial
>>>>>> Catalog=SRSNew;Integrated Security=True"
>>>>>>
>>>>>> objConn.Open()
>>>>>>
>>>>>> Application.Run(New MDIMain)
>>>>>>
>>>>>> End Sub
>>>>>>
>>>>>> I open SQL Connection and start MDI form. Everything works fine.
>>>>>> You are trying to show the form, not to start the application. This
>>>>>> is
>>>>>> the reason why it doesn't work I think.
>>>>>>
>>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>>> message
>>>>>> news:OxRgXZPXGHA.1480@TK2MSFTNGP03.phx.gbl...
>>>>>>> It doesn't like it when I turn off the framework option.
>>>>>>>
>>>>>>> Just loads the form and then exits the program.
>>>>>>>
>>>>>>> Public Sub Main()
>>>>>>>
>>>>>>> Dim NewInstance = New frmMain
>>>>>>>
>>>>>>> NewInstance.show()
>>>>>>>
>>>>>>> End Sub
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "Al" <a*@newsgroups.com> wrote in message
>>>>>>> news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>>>>>>>> In Project Properties there is a check box Enable Application
>>>>>>>> Framework. If it's checked then there is no Sub main option. If you
>>>>>>>> uncheck it then Sub Main option appears in the list of startup
>>>>>>>> objects.
>>>>>>>> You create Sub Main in a module and it works. At least I did what I
>>>>>>>> described.
>>>>>>>>
>>>>>>>> Al
>>>>>>>>
>>>>>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in
>>>>>>>> message news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>>>>>>>> This is probably the most silly question asked here but I just
>>>>>>>>> can't
>>>>>>>>> figure it out.
>>>>>>>>>
>>>>>>>>> In VB6 letting Sub Main() be the app's startup directory was real
>>>>>>>>> easy under project properties.
>>>>>>>>>
>>>>>>>>> In VB.Net however I don't see such an option, all I see is which
>>>>>>>>> form I want the program to start in.
>>>>>>>>>
>>>>>>>>> I've added a Sub Main() into forms, modules, and classes (using
>>>>>>>>> the
>>>>>>>>> shared parameter) but I just can't
>>>>>>>>> get project properties to let me choose it as the startup sub.
>>>>>>>>> It's
>>>>>>>>> always in some form_load it wants
>>>>>>>>> to startup.
>>>>>>>>>
>>>>>>>>> Why?
>>>>>>>>>
>>>>>>>>> Adam
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>
Author
11 Apr 2006 2:25 AM
gene kelley
On Tue, 11 Apr 2006 01:27:27 +0100, "Adam Honek"
<AdamHo***@Webmaster2001.freeserve.co.uk> wrote:

>It doesn't like it when I turn off the framework option.
>
>Just loads the form and then exits the program.
>
>Public Sub Main()
>
>Dim NewInstance = New frmMain
>
>NewInstance.show()
>
>End Sub
>
>

If that's the only code in your Sub Main and frmMain is your startup
object, then there is no logical reason to use a SubMain.
If there is other code, you might want to look at possibly using
Sub MyApplication_Startup in the Application Designer>

Gene


Show quoteHide quote
>
>"Al" <a*@newsgroups.com> wrote in message
>news:%23HvdZPPXGHA.752@TK2MSFTNGP02.phx.gbl...
>> In Project Properties there is a check box Enable Application Framework.
>> If it's checked then there is no Sub main option. If you uncheck it then
>> Sub Main option appears in the list of startup objects.
>> You create Sub Main in a module and it works. At least I did what I
>> described.
>>
>> Al
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
>> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>>> This is probably the most silly question asked here but I just can't
>>> figure it out.
>>>
>>> In VB6 letting Sub Main() be the app's startup directory was real easy
>>> under project properties.
>>>
>>> In VB.Net however I don't see such an option, all I see is which form I
>>> want the program to start in.
>>>
>>> I've added a Sub Main() into forms, modules, and classes (using the
>>> shared parameter) but I just can't
>>> get project properties to let me choose it as the startup sub. It's
>>> always in some form_load it wants
>>> to startup.
>>>
>>> Why?
>>>
>>> Adam
>>>
>>
>>
>
Author
11 Apr 2006 6:45 AM
Cor Ligthert [MVP]
Adam,

One of the thousand messages Armin, Herfried and Jay have written about this
in this newsgroup.

It is an old message from Herfried but therefore probably very good in your
case.

http://groups.google.com/group/microsoft.public.dotnet.languages.vb/msg/1f37ecbe95e32ad1

If you want to read more about it, than check for the by them often used
word messagepump.

I don't use it in form applications the inbuild is fine enough for me.

I hope this helps,

Cor


Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht
news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
> This is probably the most silly question asked here but I just can't
> figure it out.
>
> In VB6 letting Sub Main() be the app's startup directory was real easy
> under project properties.
>
> In VB.Net however I don't see such an option, all I see is which form I
> want the program to start in.
>
> I've added a Sub Main() into forms, modules, and classes (using the shared
> parameter) but I just can't
> get project properties to let me choose it as the startup sub. It's always
> in some form_load it wants
> to startup.
>
> Why?
>
> Adam
>
Author
11 Apr 2006 11:56 PM
Adam Honek
Hmmm, that's how I expect things to work, more how VB6 RIP worked. Thanks.

So why the framework? What exactly happens when it's disabled in the
application settings?

The .NET framework it used anyhow is it not?

Maybe MS is trying to tell us there's no point in using Sub Main() anymore,
it's fine to just use a startup forms _load or _activate event?

Adam


Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OO3NPNTXGHA.4652@TK2MSFTNGP04.phx.gbl...
> Adam,
>
> One of the thousand messages Armin, Herfried and Jay have written about
> this in this newsgroup.
>
> It is an old message from Herfried but therefore probably very good in
> your case.
>
> http://groups.google.com/group/microsoft.public.dotnet.languages.vb/msg/1f37ecbe95e32ad1
>
> If you want to read more about it, than check for the by them often used
> word messagepump.
>
> I don't use it in form applications the inbuild is fine enough for me.
>
> I hope this helps,
>
> Cor
>
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht
> news:%23DtJv1OXGHA.3760@TK2MSFTNGP02.phx.gbl...
>> This is probably the most silly question asked here but I just can't
>> figure it out.
>>
>> In VB6 letting Sub Main() be the app's startup directory was real easy
>> under project properties.
>>
>> In VB.Net however I don't see such an option, all I see is which form I
>> want the program to start in.
>>
>> I've added a Sub Main() into forms, modules, and classes (using the
>> shared parameter) but I just can't
>> get project properties to let me choose it as the startup sub. It's
>> always in some form_load it wants
>> to startup.
>>
>> Why?
>>
>> Adam
>>
>
>