Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

VB SIX COUNTDOWN


  • Please log in to reply

#1
sumguy

sumguy

    Member

  • Member
  • PipPip
  • 54 posts
hello. i need help to create a program in visual basic that will countdown the days till June 14th 2008. Also, please help me =) srry for my noobness.. :)
  • 0

Advertisements


#2
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 33,101 posts
That sounds like a school assignment to me. :)
  • 0

#3
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
HAHA i promise its not a school assignment. i just got visual basic. The only class I'm in at school is Java, and i don't know how to make the counter...so please help haha :)
  • 0

#4
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 33,101 posts
This should get you on your way:

http://www.daniweb.c...ead.php?t=17352
http://www.vbdotnetf...ead.php?p=20867
  • 0

#5
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
Those are for the time, i need it for the date..

Here is something i was messing with.

Private Sub Command1_Click()
Dim strMsg As String
strMsg = Date
strMsg = strMsg & "is the last day of School!!"
Text1.Text = strMsg
End Sub



Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub


I need to have like, days remaining.
  • 0

#6
sandokas

sandokas

    Member

  • Member
  • PipPip
  • 17 posts
intDaysRemaining = Day(dateVariable - Now)

?
  • 0

#7
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
thnx for the reply, i appreciate it...and also, do you happen to know how to edit the "company" part.... is it App.Company "watever"
  • 0

#8
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
also, wen i do it, it prints "False is the last day of school'
  • 0

#9
sandokas

sandokas

    Member

  • Member
  • PipPip
  • 17 posts
You declared a boolean to have False?

Also to edit Assembly Info if you're in .net you can open AssemblyInfo.cs file on Properties where your project lies, or right click the project, properties, application, assembly information button.
  • 0

#10
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
kk, im in vb6....and what i am looking to do is this: Create a program that has the following.

Calendar
Text Box that will say : X days remaining till summer
Command button to say the above..

So basically, i need it to do the difference of Todays Date, and June 14th, and say the number of days.

Heres my code
Private Sub Command1_Click()
Dim strMsg As String
strMsg = intDaysRemaining = Day(dateVariable - Now, True)
strMsg = strMsg & "days left of school"
Text1.Text = strMsg
End Sub

Now it gives me the erro on the word "Day" saying wrong number of aruments, or invalid property/

Edited by sumguy, 12 January 2008 - 11:42 AM.

  • 0

#11
sandokas

sandokas

    Member

  • Member
  • PipPip
  • 17 posts

strMsg = intDaysRemaining = Day(dateVariable - Now, True)


You cannot equal two times. = means that you are giving the value of the right expression to the variable in the left. Only one per line please. :-)

Also i think Day() can accept only a pass parameter as Int Day(Date). I have no idea what Int Day(Date,Bollean) overload does.


Ok, if you're really desperate and THAT lazy here's something fast that might help you:

Dim dateVariable As Date
dateVariable = #6/14/08#
strMsg = Day(dateVariable - Now) & "days left of school"

Edited by sandokas, 14 January 2008 - 06:02 AM.

  • 0

#12
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
Thanks for your help so far, and also haha, the thing you told me to try, with the #6/14/2008# ...i dont think it works, because it tells me that there is 30 days left, but in actuality there is what, 5 months ahah..
  • 0

#13
sandokas

sandokas

    Member

  • Member
  • PipPip
  • 17 posts

Thanks for your help so far, and also haha, the thing you told me to try, with the #6/14/2008# ...i dont think it works, because it tells me that there is 30 days left, but in actuality there is what, 5 months ahah..


Oh i see.. Just replace Day by CInt and you're set to go!

Dim dateVariable As Date
dateVariable = #6/14/08#
strMsg = CInt(dateVariable - Now) & "days left of school"
  • 0

#14
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
It worked, thank you so much =)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP