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
Kinda verbose, if you want my opinion.
yeah that was verbose. you don't have to fully qualify System.Windows.Forms.MessageBox.Show though.
MessageBox.Show() would work.
Quote from: banditxx99 on May 28, 2003, 03:14 PM
yeah that was verbose. you don't have to fully qualify System.Windows.Forms.MessageBox.Show though.
MessageBox.Show() would work.
That's not necessarily ture.
I have vb.net uploaded, 3 isos out of 4.
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.
QuoteI have vb.net uploaded, 3 isos out of 4.
Missing a CD? I count five. Maybe you don't need the component update one.
Quote from: banditxx99 on May 28, 2003, 08:30 PM
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.
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.
Granted my vb.net knowledge is far lower than c#.. so i have a question.
Would
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
or
Me.Close()
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.
What means? Not using .NET? ;)
Quote from: banditxx99 on May 29, 2003, 09:44 AM
Granted my vb.net knowledge is far lower than c#.. so i have a question.
Would
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
or
Me.Close()
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.
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.
Quote from: Etheran on May 29, 2003, 05:01 PM
Quote from: banditxx99 on May 29, 2003, 09:44 AM
Granted my vb.net knowledge is far lower than c#.. so i have a question.
Would
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
or
Me.Close()
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.
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
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
angryhickclowN on AIM. Nice to see you back.