Staredit Network

Staredit Network -> Computers and Technical -> VB Help
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-21 at 11:12:43
Yea, well i have never had time to learn vb so im looking at the tutorial on vbtutor.net

My question is this:

go to Lesson 2 on vbtutor.net and scroll down where it shows you the
Form1.Show
Print"Welcome to the Visual Basic Tutorial"

i get this error

user posted image

user posted image

wtf?!?!?!!??!111
Report, edit, etc...Posted by LegacyWeapon on 2006-08-21 at 12:02:48
Read the error...

Use "Me.Show"
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-21 at 12:22:05
QUOTE(LegacyWeapon @ Aug 21 2006, 12:02 PM)
Read the error...

Use "Me.Show"
[right][snapback]548211[/snapback][/right]


hmmm w/e

Ok now i started the debugged just to play it and this is what has shown:

user posted image
http://img201.imageshack.us/my.php?image=hi3vn3.png

wtf again
Report, edit, etc...Posted by LegacyWeapon on 2006-08-21 at 17:52:09
CODE
Print "Welcome to Visual Basic Tutorial"
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-21 at 21:55:23
QUOTE(LegacyWeapon @ Aug 21 2006, 05:51 PM)
CODE
Print "Welcome to Visual Basic Tutorial"

[right][snapback]548381[/snapback][/right]


Yea thats what i did and it gave me that other error thingy

it like put ()'s around the "Welcome to the Visual Basic Tutorial"

why? help
Report, edit, etc...Posted by LegacyWeapon on 2006-08-21 at 22:56:53
Without the space the function makes it return something. VB's error says it cannot turn that text into a integer.

Difference is:
CODE
MessageBox = MsgBox("Hello!")
vs
CODE
MsgBox "Hello!"

CODE
MsgBox ("Hello!")
^That should also work.
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-22 at 12:21:21
Oh, i see what you mean, thanks Legacy.
Report, edit, etc...Posted by fatimid08 on 2006-08-23 at 07:06:31
You have visual basic 2005 express, which is vb.net. The tutorial that you are using is for vb 6, which is NOT good for the version you are using. Look for a vb .net or vb 2005 tutorial somewhere.

Here is the equivalent code that should work :

Dim g As System.Drawing.Graphics = Me.CreateGraphics()
g.DrawString("Welcume to Visual Basic Tutorial",Me.Font,System.Drawing.Brushes.Black,0,0)
g.Dispose()
g = Nothing
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-23 at 11:27:26
QUOTE(fatimid08 @ Aug 23 2006, 07:06 AM)
You have visual basic 2005 express, which is vb.net. The tutorial that you are using is for vb 6, which is NOT good for the version you are using. Look for a vb .net or vb 2005 tutorial somewhere.

Here is the equivalent code that should work :

Dim g As System.Drawing.Graphics = Me.CreateGraphics()
g.DrawString("Welcume to Visual Basic Tutorial",Me.Font,System.Drawing.Brushes.Black,0,0)
g.Dispose()
g = Nothing
[right][snapback]549112[/snapback][/right]


O ok thanks i didnt know that if i used a vb6 tutorial it would make any difference.

Im using Vb5 express. Ill try to find a tutorial for it. If anyone else has one, please post it here. Please Please Please
Report, edit, etc...Posted by fatimid08 on 2006-08-23 at 16:07:00
Look around in the Learn section of the Windows Forms website
You can also look in the VB.Net section of the Code Project.

The Visual Basic .Net 2002 or 2003 articles work fine with 2005 for the most part.

If you need a reference or if you need to know what a class does, you can use the MSDN Library under .Net Development / .Net Framework SDK / .Net Framework Class Library. For the vb syntax, go under Development Tools and Languages / Visual Studio / Visual Basic.

For the rest, Google works just fine in most cases.
Report, edit, etc...Posted by DT_Battlekruser on 2006-08-23 at 20:09:38
QUOTE(LegacyWeapon @ Aug 21 2006, 07:56 PM)
Without the space the function makes it return something. VB's error says it cannot turn that text into a integer.

Difference is:
CODE
MessageBox = MsgBox("Hello!")
vs
CODE
MsgBox "Hello!"

CODE
MsgBox ("Hello!")
^That should also work.
[right][snapback]548493[/snapback][/right]


It took Print() and parsed it as int().
Report, edit, etc...Posted by Xx.Doom.xX on 2006-08-24 at 20:15:41
So i had to do MsgBox to not make it mistake it as an integer?
Next Page (1)