Valhalla Legends Forums Archive | General Programming | My first VB.NET program.

AuthorMessageTime
Grok
[code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
System.Windows.Forms.MessageBox.Show("Hello, World!", "Test Application Message Box", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
Me.Close()
End Sub
[/code]

Kinda verbose, if you want my opinion.
May 28, 2003, 6:38 PM
banditxx99
yeah that was verbose. you don't have to fully qualify System.Windows.Forms.MessageBox.Show though.

MessageBox.Show() would work.
May 28, 2003, 8:14 PM
Etheran
[quote author=banditxx99 link=board=5;threadid=1469;start=0#msg11002 date=1054152877]
yeah that was verbose. you don't have to fully qualify System.Windows.Forms.MessageBox.Show though.

MessageBox.Show() would work.
[/quote]That's not necessarily ture.
May 29, 2003, 12:35 AM
St0rm.iD
I have vb.net uploaded, 3 isos out of 4.
May 29, 2003, 1:29 AM
banditxx99
For him it would since he already has a reference to the System.Windows.Forms namespace.

But in general, providing a reference to the namespace in question will allow you to forego with the full qualification to objects within that namespace.
May 29, 2003, 1:30 AM
K
[quote]I have vb.net uploaded, 3 isos out of 4. [/quote]
Missing a CD? I count five. Maybe you don't need the component update one.
May 29, 2003, 2:55 AM
Etheran
[quote author=banditxx99 link=board=5;threadid=1469;start=0#msg11022 date=1054171801]
For him it would since he already has a reference to the System.Windows.Forms namespace.

But in general, providing a reference to the namespace in question will allow you to forego with the full qualification to objects within that namespace.
[/quote]In most cases, yes, he would have a reference to the namespace; however, it is not a good idea to assume he, in fact, does have System.Windows.Forms referenced.
May 29, 2003, 7:50 AM
banditxx99
Granted my vb.net knowledge is far lower than c#.. so i have a question.

Would

[code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
[/code]

or
[code]
Me.Close()
[/code]

even compile without a reference to System.Windows.Forms? In my test, it would not.. but maybe I'm missing something.

Anyway, my point was you can make it verbose, or use the means available to you to make it less verbose.
May 29, 2003, 2:44 PM
Yoni
What means? Not using .NET? ;)
May 29, 2003, 2:46 PM
Etheran
[quote author=banditxx99 link=board=5;threadid=1469;start=0#msg11056 date=1054219471]
Granted my vb.net knowledge is far lower than c#.. so i have a question.

Would

[code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
[/code]

or
[code]
Me.Close()
[/code]

even compile without a reference to System.Windows.Forms? In my test, it would not.. but maybe I'm missing something.

Anyway, my point was you can make it verbose, or use the means available to you to make it less verbose.
[/quote]Me.Close() should compile just fine. I, too, am more of a c# fan and am not sure if MyBase.Load would compile without System.Windows.Forms referenced.
May 29, 2003, 10:01 PM
Etheran
[quote author=Etheran link=board=5;threadid=1469;start=0#msg11081 date=1054245707]
[quote author=banditxx99 link=board=5;threadid=1469;start=0#msg11056 date=1054219471]
Granted my vb.net knowledge is far lower than c#.. so i have a question.

Would

[code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
[/code]

or
[code]
Me.Close()
[/code]

even compile without a reference to System.Windows.Forms? In my test, it would not.. but maybe I'm missing something.

Anyway, my point was you can make it verbose, or use the means available to you to make it less verbose.
[/quote]Me.Close() should compile just fine. I, too, am more of a c# fan and am not sure if MyBase.Load would compile without System.Windows.Forms referenced.

However, that was not the point I was trying to make :p
[/quote]
May 29, 2003, 10:04 PM
Xae
Long time no see $t0rm =) I've gotta get ahold of you btw

And grok, vb.net is not all that verbose, it is better for some things than others =x

I prefer programming in c#, more or less because it is almost a java clone with .net capabilities =) however its identicle to vb.net in the sense that if you drop the semi colons, and add a few dim statements you get a vb.net app =x
June 18, 2003, 12:33 PM
St0rm.iD
angryhickclowN on AIM. Nice to see you back.
June 18, 2003, 7:45 PM

Search