Page 1 of 1

Anyone into VB?

Posted: Thu Oct 25, 2007 9:09 pm
by TwelveEleven
Well, so I've finally started VB/C/C++, and now I encountered my first problem.. (And yes I don't know any tech forums :P)

I'm trying to make a stopwatch, but it ain't really working out..

So if you have some VB knowledge, please help me:

Visually: Image
Code: Image


<3,
twelve

Posted: Thu Oct 25, 2007 9:12 pm
by TacticalMedic
I believe I know even less than you, care to explain what exatcly are you doing? Writing programs?

Posted: Thu Oct 25, 2007 9:16 pm
by TwelveEleven
I'm trying to program a stopwatch :P

Posted: Thu Oct 25, 2007 9:18 pm
by Luoma
lol i recently started working a little with VB, got as a calculator O.o

that is too hard for me =(

Posted: Thu Oct 25, 2007 9:20 pm
by TwelveEleven
Luoma wrote:lol i recently started working a little with VB, got as a calculator O.o

that is too hard for me =(


I read simple, and thought that would be something for me lol :P

Posted: Thu Oct 25, 2007 9:32 pm
by Innovacious
vb.net? yuck.

I still use 6. So does my college, .net kills the network :banghead:

Anywho, ill have a look

Posted: Thu Oct 25, 2007 9:33 pm
by PB_and_J
<---Taking a VB class at HS, we have hardly done anything though....

Posted: Thu Oct 25, 2007 9:35 pm
by GEF_Slayer
thought u ment victorian bitter/ VB the beer lol

Posted: Thu Oct 25, 2007 9:43 pm
by Innovacious
well, i just made a simple form with a label a timer and a button.

Used your code and it worked

Code: Select all

Private Sub Command1_Click()
  Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
  Label1.Caption = Format(Val(Label1.Caption) + 0.01, "fixed")
End Sub


although your interval is wrong on your timer, 1000 is a second. If your doing milliseconds in that format then thats still wrong, should be 10 i think (unless its dif in vb.net)

edit: oooh :banghead: you must be doing it in milliseconds cus there arnt 100 seconds in a min, lol

ANOTER edit: your errors seem to be with the label. Have you named it right?

I FOUND THE SOLUTION

youre using vb 6 code. in vb.net they replace .caption with .text for some stupid reason

Posted: Thu Oct 25, 2007 9:59 pm
by flynch
autoit wud be better tbh. i prefer c++ but for sumthin so simple your better off with autoit. u cud do it in 10 lines. i'd write it now 4 u but im feelin sik and i only hav 1 hand hence the shit gramma

Posted: Thu Oct 25, 2007 10:41 pm
by TwelveEleven
Innovacious wrote:well, i just made a simple form with a label a timer and a button.

Used your code and it worked

Code: Select all

Private Sub Command1_Click()
  Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
  Label1.Caption = Format(Val(Label1.Caption) + 0.01, "fixed")
End Sub


although your interval is wrong on your timer, 1000 is a second. If your doing milliseconds in that format then thats still wrong, should be 10 i think (unless its dif in vb.net)

edit: oooh :banghead: you must be doing it in milliseconds cus there arnt 100 seconds in a min, lol

ANOTER edit: your errors seem to be with the label. Have you named it right?

I FOUND THE SOLUTION

youre using vb 6 code. in vb.net they replace .caption with .text for some stupid reason


Ok, thanks. But i'm using vb 2008 beta 2 since you're wondering. Thanks for that though :) <3 i'll see if it works now

Posted: Thu Oct 25, 2007 10:44 pm
by Innovacious
TwelveEleven wrote:Ok, thanks. But i'm using vb 2008 beta 2 since you're wondering. Thanks for that though :) <3 i'll see if it works now


Lol, i really should upgrade to a newer version of vb shouldnt i

Posted: Thu Oct 25, 2007 10:47 pm
by TwelveEleven
Innovacious wrote:
TwelveEleven wrote:Ok, thanks. But i'm using vb 2008 beta 2 since you're wondering. Thanks for that though :) <3 i'll see if it works now


Lol, i really should upgrade to a newer version of vb shouldnt i


guess so, minor question. When i 'build' something, where can i find the build file? (as in where does it save to?)

Posted: Thu Oct 25, 2007 10:58 pm
by Innovacious
TwelveEleven wrote:
Innovacious wrote:
TwelveEleven wrote:Ok, thanks. But i'm using vb 2008 beta 2 since you're wondering. Thanks for that though :) <3 i'll see if it works now


Lol, i really should upgrade to a newer version of vb shouldnt i


guess so, minor question. When i 'build' something, where can i find the build file? (as in where does it save to?)


you dont build stuff in vb 6. You just run it, if you want a .exe in vb 6 you have to go to file/make "projectname".exe

the version youre using is different by the sounds of it

Posted: Fri Oct 26, 2007 1:00 am
by PR0METHEUS
So is this VB 6.0 or VB.NET? I'm more familiar with VB 6.0 myself. Trying to get a VB programming job actually... *crosses fingers*

Innovacious wrote:I FOUND THE SOLUTION

youre using vb 6 code. in vb.net they replace .caption with .text for some stupid reason


Yeah I was just going to say, the compiler was not recognizing Timer1.Caption (blue underline). Normally if you Just type the class name and a period (aka Timer1.) it will give you a list of valid classes you can use. I'm guessing Caption does not show up in that list.

Posted: Fri Oct 26, 2007 2:36 am
by -Evan
Your asking at the wrong place... Go here

Posted: Fri Oct 26, 2007 3:40 am
by Midori
-Evan wrote:Your asking at the wrong place... Go here


*sigh*

Posted: Fri Oct 26, 2007 3:44 am
by †erminal
I used a calculator today, yes, ALL BY MYSELF.

Posted: Fri Oct 26, 2007 4:01 am
by -Evan
X-Lax wrote:
-Evan wrote:Your asking at the wrong place... Go here


*sigh*


what's your point?

Posted: Fri Oct 26, 2007 4:51 am
by DeathBeforeDishonor
i thought this was about beer, VB is aussie brand of beer (that tastes like crap)

Posted: Fri Oct 26, 2007 9:43 am
by TwelveEleven
TehUrbanNinja wrote:i thought this was about beer, VB is aussie brand of beer (that tastes like crap)


Gimme a leffe double/blond MmMMmMmmmM, now THAT'S beer!

Re: Anyone into VB?

Posted: Fri Oct 26, 2007 9:20 pm
by micheal_safian
TwelveEleven wrote:Well, so I've finally started VB/C/C++, and now I encountered my first problem.. (And yes I don't know any tech forums :P)

I'm trying to make a stopwatch, but it ain't really working out..

So if you have some VB knowledge, please help me:

Visually: Image
Code: Image


<3,
twelve

:D :D :D
man read the error man the line u wrote the Label class doesn't got Caption property use instead Label1.Text property.As the caption property has changed in VB.net to Text property ....

Re: Anyone into VB?

Posted: Fri Oct 26, 2007 9:45 pm
by PR0METHEUS
micheal_safian wrote: :D :D :D
man read the error man the line u wrote the Label class doesn't got Caption property use instead Label1.Text property.As the caption property has changed in VB.net to Text property ....


man read the above posts in this thread man... Perhaps use punctuation too?

A few people have already pointed out that the compiler cannot find the .Caption class, and have suggested using .Text instead. :P