Newbie question


A

Alice

I am a VB .Net newbie trying to re-code an application from VB to VB .Net
03. The application starts with a login form(frmLogin) that verify users'
identity before loading the main menu form(frmMenu). frmLogin is unloaded
once frmMenu is loaded.

In VB, this is how I do it:

In frmLogin....

Private Sub cmdLogin_Click()

'Some codes here

frmMenu.Show
Unload Me
Set frmLogin = Nothing
' End If
End Sub


But in VB .NET 03, the following code, which is similar, does not work.

In frmLogin...

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click
Dim Menu As New frmMenu
Menu.Show()
Me.Close()
End Sub


I do not want frmLogin to be around after frmMenu is loaded. I tried using
the upgrade wizard in VB .Net and the result is the same. Could anybody
advice me on the correct way to do it?
 
Ad

Advertisements

A

Armin Zingler

Alice said:
I do not want frmLogin to be around after frmMenu is loaded. I
tried using the upgrade wizard in VB .Net and the result is the same.
Could anybody advice me on the correct way to do it?
Shared sub main
dim LoginForm as new loginform
if loginform.showdialog = ok then
application.run(new mainform)
end if
end sub
 
O

One Handed Man [ OHM# ]

Good answer Armin.

Regards - OHM

Armin said:
Shared sub main
dim LoginForm as new loginform
if loginform.showdialog = ok then
application.run(new mainform)
end if
end sub
 
A

Alice

Do you mean I have to add a new module to my project, type in the codes you
provided and also change the startup object to sub main?

I tried out the above mentioned steps and it works only if I remove the
"Shared" before Sub Main. That's because the build error task description
said "Methods in a Module cannot be declared 'Shared'."

Please let me know if my understanding of your answer is correct. Thanks.
 
O

One Handed Man [ OHM# ]

Not at all.

Purely a nice, simple solution.

Regards - OHM
 
Ad

Advertisements

A

Armin Zingler

Alice said:
Do you mean I have to add a new module to my project, type in the
codes you provided and also change the startup object to sub main?

I tried out the above mentioned steps and it works only if I remove
the "Shared" before Sub Main. That's because the build error task
description said "Methods in a Module cannot be declared
'Shared'."

Please let me know if my understanding of your answer is correct.
Thanks.
You're absolutely right. In a Module all members are shared, so you have to
remove "Shared". Only if you had put my code in your current startup object,
a Form, Shared would have been necessary. Using a Module is "better".
 
M

Mike Bulava

Since you've already been given an answer I'm not going to answer you
question again. But I know this particlular problem was driving me nuts for
awhile when I started using VB.Net after it came out. And this is what I've
realized. VB.Net is the coolest thing since sliced bread, it starts to
teach you why people really looked down at VB programmer because of what VB
lacked as a language because it wasn't a True OOP lanuage. Since Learning
VB.Net C++ (With .net and without) as well as C# have been very easy to
learn because I've already learned that everything that is used in VB.net is
an Object a realy object and all other language (at least the ones I've
learned so far) are the exact same way (except for syntax but that's easy to
learn), then I go back to using VB 6 Say man I hate this the hell with it
I'm going to just rewrite this componet in .Net

Sorry Just had to throw something in. .Net is a big learning curve from VB
5 or 6 but stick with it and once it all starts to click you'll never want
to look at the old VB again.
 
O

One Handed Man [ OHM# ]

Having said that, there are some things in .NET which are not natively as
good. For example, ADO.NET is a disconnected environment which in itself
caused problems for designers who want to use it but also want record
locking.

Exposure in the class library for stuff like USB just is not there. Apart
from that and a few other things. Yes, its cool.

Regards - OHM
 
C

Cor

Hi OHM,

Reading this, because locking has my intrest also there was a for me
intresting discussion in the ADOnet group yesterday about recordlocking,
maybe you can have a look at it.

(optimistic concurrency)

Cor
 
T

Tom Leylan

One Handed Man said:
Having said that, there are some things in .NET which are not natively as
good. For example, ADO.NET is a disconnected environment which in itself
caused problems for designers who want to use it but also want record
locking.

Exposure in the class library for stuff like USB just is not there. Apart
from that and a few other things. Yes, its cool.
Try and keep the concepts of "VB.Net language" and ".Net framework"
separate. For instance, there is no "database access" at all in either C or
C++ which is not a negative reflection on the language. USB support and
ADO.Net are not part of the VB.Net language.

VB6 was considered by many to be a poorly designed language, that didn't
mean it wasn't fun or easy or worthwhile or cheap or anything else... it
meant it was a poorly designed language. Mike simply pointed out a fact.

Tom
 
Ad

Advertisements

O

One Handed Man [ OHM# ]

Dont get picky. I know what I meant and so do you.

OHM
 
T

Tom Leylan

Gosh... well okay I'm the picky guy :) Mike made a fine observation and
(let me check) "yup" you butted in not me. And now I'm picky. I'm going to
skip your reply if you don't mind because I'm certain I won't understand it.
And of course you'll mind :)

Time for you post another off-topic silly joke followed immediately by a
complaint to somebody who posts an off-topic programming question...

What can I say? You're right (that won't work either of course.) Pardon my
interrupting your view of the world
 
O

One Handed Man [ OHM# ]

Wanker !



Tom said:
Gosh... well okay I'm the picky guy :) Mike made a fine observation
and (let me check) "yup" you butted in not me. And now I'm picky.
I'm going to skip your reply if you don't mind because I'm certain I
won't understand it. And of course you'll mind :)

Time for you post another off-topic silly joke followed immediately
by a complaint to somebody who posts an off-topic programming
question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


One Handed Man said:
Dont get picky. I know what I meant and so do you.

OHM


Tom said:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who want
to use it but also want record locking.

Exposure in the class library for stuff like USB just is not there.
Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net framework"
separate. For instance, there is no "database access" at all in
either C or C++ which is not a negative reflection on the language.
USB support and ADO.Net are not part of the VB.Net language.

VB6 was considered by many to be a poorly designed language, that
didn't mean it wasn't fun or easy or worthwhile or cheap or anything
else... it meant it was a poorly designed language. Mike simply
pointed out a fact.

Tom
 
T

Tom Leylan

Excellent... (and expected)


One Handed Man said:
Wanker !



Tom said:
Gosh... well okay I'm the picky guy :) Mike made a fine observation
and (let me check) "yup" you butted in not me. And now I'm picky.
I'm going to skip your reply if you don't mind because I'm certain I
won't understand it. And of course you'll mind :)

Time for you post another off-topic silly joke followed immediately
by a complaint to somebody who posts an off-topic programming
question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


One Handed Man said:
Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who want
to use it but also want record locking.

Exposure in the class library for stuff like USB just is not there.
Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net framework"
separate. For instance, there is no "database access" at all in
either C or C++ which is not a negative reflection on the language.
USB support and ADO.Net are not part of the VB.Net language.

VB6 was considered by many to be a poorly designed language, that
didn't mean it wasn't fun or easy or worthwhile or cheap or anything
else... it meant it was a poorly designed language. Mike simply
pointed out a fact.

Tom
 
O

One Handed Man [ OHM# ]

And well deserved.

OHM


Tom said:
Excellent... (and expected)


One Handed Man said:
Wanker !



Tom said:
Gosh... well okay I'm the picky guy :) Mike made a fine
observation and (let me check) "yup" you butted in not me. And now
I'm picky. I'm going to skip your reply if you don't mind because
I'm certain I won't understand it. And of course you'll mind :)

Time for you post another off-topic silly joke followed immediately
by a complaint to somebody who posts an off-topic programming
question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who
want to use it but also want record locking.

Exposure in the class library for stuff like USB just is not
there. Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net
framework" separate. For instance, there is no "database access"
at all in either C or C++ which is not a negative reflection on
the language. USB support and ADO.Net are not part of the VB.Net
language.

VB6 was considered by many to be a poorly designed language, that
didn't mean it wasn't fun or easy or worthwhile or cheap or
anything else... it meant it was a poorly designed language.
Mike simply pointed out a fact.

Tom
 
Ad

Advertisements

T

Tom Leylan

I hope to be as snappy with the responses when I'm 10 years old.

One Handed Man said:
And well deserved.

OHM


Tom said:
Excellent... (and expected)


One Handed Man said:
Wanker !



Tom Leylan wrote:
Gosh... well okay I'm the picky guy :) Mike made a fine
observation and (let me check) "yup" you butted in not me. And now
I'm picky. I'm going to skip your reply if you don't mind because
I'm certain I won't understand it. And of course you'll mind :)

Time for you post another off-topic silly joke followed immediately
by a complaint to somebody who posts an off-topic programming
question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who
want to use it but also want record locking.

Exposure in the class library for stuff like USB just is not
there. Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net
framework" separate. For instance, there is no "database access"
at all in either C or C++ which is not a negative reflection on
the language. USB support and ADO.Net are not part of the VB.Net
language.

VB6 was considered by many to be a poorly designed language, that
didn't mean it wasn't fun or easy or worthwhile or cheap or
anything else... it meant it was a poorly designed language.
Mike simply pointed out a fact.

Tom
 
O

One Handed Man [ OHM# ]

Well Tom,


Try
'Tom needs to visit www.handbag.com
Catch ex As TheGossip
'Take a look at your life
Finally
'Fu*k off somewhere else
End Try

OHM





Tom said:
I hope to be as snappy with the responses when I'm 10 years old.

One Handed Man said:
And well deserved.

OHM


Tom said:
Excellent... (and expected)


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Wanker !



Tom Leylan wrote:
Gosh... well okay I'm the picky guy :) Mike made a fine
observation and (let me check) "yup" you butted in not me. And
now I'm picky. I'm going to skip your reply if you don't mind
because I'm certain I won't understand it. And of course you'll
mind :)

Time for you post another off-topic silly joke followed
immediately by a complaint to somebody who posts an off-topic
programming question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who
want to use it but also want record locking.

Exposure in the class library for stuff like USB just is not
there. Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net
framework" separate. For instance, there is no "database
access" at all in either C or C++ which is not a negative
reflection on the language. USB support and ADO.Net are not
part of the VB.Net language.

VB6 was considered by many to be a poorly designed language,
that didn't mean it wasn't fun or easy or worthwhile or cheap or
anything else... it meant it was a poorly designed language.
Mike simply pointed out a fact.

Tom
 
T

Tom Leylan

Here's another reply... your turn


One Handed Man said:
Well Tom,


Try
'Tom needs to visit www.handbag.com
Catch ex As TheGossip
'Take a look at your life
Finally
'Fu*k off somewhere else
End Try

OHM





Tom said:
I hope to be as snappy with the responses when I'm 10 years old.

One Handed Man said:
And well deserved.

OHM


Tom Leylan wrote:
Excellent... (and expected)


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Wanker !



Tom Leylan wrote:
Gosh... well okay I'm the picky guy :) Mike made a fine
observation and (let me check) "yup" you butted in not me. And
now I'm picky. I'm going to skip your reply if you don't mind
because I'm certain I won't understand it. And of course you'll
mind :)

Time for you post another off-topic silly joke followed
immediately by a complaint to somebody who posts an off-topic
programming question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who
want to use it but also want record locking.

Exposure in the class library for stuff like USB just is not
there. Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net
framework" separate. For instance, there is no "database
access" at all in either C or C++ which is not a negative
reflection on the language. USB support and ADO.Net are not
part of the VB.Net language.

VB6 was considered by many to be a poorly designed language,
that didn't mean it wasn't fun or easy or worthwhile or cheap or
anything else... it meant it was a poorly designed language.
Mike simply pointed out a fact.

Tom
 
Ad

Advertisements

S

scorpion53061

Coming to a pay per view channel soon....

The Battle of the VB.NET Giants!!

Don't miss this huge extravanganza!! Its the biggest fight since the thrilla
in manilla!!

In one corner weighted with the knowledge of System.Relection, and the
current title holder of the Master of the .NET Framework Title, (apologies
to Herfried of course) is...

Tom Leylan

In the other corner the challenger weighs in with his expertise on
datagrids, graphics, inheritance, brimming with confidence is, the heir
apparent to the master of the framework title is

One Handed Man

They will compete in a no holds barred fight to the death battle to obtain
the crown of who can be the most childish!!

Folks, this is going to be a doozy. Both sides are so evenly matched. Get
the chips, the beer (or soda if that suits you) and get ready for The
Newsgroup Rumble of the Century!!

:)

Tom said:
Here's another reply... your turn


One Handed Man said:
Well Tom,


Try
'Tom needs to visit www.handbag.com
Catch ex As TheGossip
'Take a look at your life
Finally
'Fu*k off somewhere else
End Try

OHM





Tom said:
I hope to be as snappy with the responses when I'm 10 years old.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message And well deserved.

OHM


Tom Leylan wrote:
Excellent... (and expected)


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Wanker !



Tom Leylan wrote:
Gosh... well okay I'm the picky guy :) Mike made a fine
observation and (let me check) "yup" you butted in not me. And
now I'm picky. I'm going to skip your reply if you don't mind
because I'm certain I won't understand it. And of course you'll
mind :)

Time for you post another off-topic silly joke followed
immediately by a complaint to somebody who posts an off-topic
programming question...

What can I say? You're right (that won't work either of course.)
Pardon my interrupting your view of the world


"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message Dont get picky. I know what I meant and so do you.

OHM


Tom Leylan wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote...
Having said that, there are some things in .NET which are not
natively as good. For example, ADO.NET is a disconnected
environment which in itself caused problems for designers who
want to use it but also want record locking.

Exposure in the class library for stuff like USB just is not
there. Apart from that and a few other things. Yes, its cool.

Try and keep the concepts of "VB.Net language" and ".Net
framework" separate. For instance, there is no "database
access" at all in either C or C++ which is not a negative
reflection on the language. USB support and ADO.Net are not
part of the VB.Net language.

VB6 was considered by many to be a poorly designed language,
that didn't mean it wasn't fun or easy or worthwhile or cheap or
anything else... it meant it was a poorly designed language.
Mike simply pointed out a fact.

Tom
 

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

Similar Threads

Newbie Question 2
Newby question 4
Newbie question 19
Newbie Question 5
Newbie question 1
Newbie Questions 1
Newbie Question 3
NEWBIE question 5

Top