• home
  • forum
  • my
  • kt
  • download
  • Date Calculator

    Author: 2008-09-13 17:53:34 From:

    Welcome to this very simply date calculator!

    What we're doing!

    Basically we'll be making a program that calculates the date difference between the two dates specified!

    GUI (LAYOUT):
    This is my GUI:

    This image has been resized. Click this bar to view the full image. The original image is sized 800x600 and weights 183KB.


    ----------------------------------------------------------------

    What you need~
    1 Command Button with:
    Name: cmdCalc
    Caption: Calculate!

    1 ListBox with:
    Name: lstAnswer

    ----------------------------------------------------------------
    CODE (Very short & simple!)

    Add this code into General Declarations before you begin adding the rest of the code:

    Quote:
    Private Mint As Integer
    ----------------------------------------------------------------

    Then add this code:

    Quote:
    Private Sub cmdCalc_Click()
    Mint = DateDiff("d", "5/09/2007", "11/09/2007")
    lstAnswer.AddItem "The day difference = " & Mint
    End Sub
    ----------------------------------------------------------------

    Code Explanation:

    Quote:
    Private Sub cmdCalc_Click()
    Basically means whenever you click on the cmdCalc button ("Calculate!" button), do the code that's specified below the line.

    ----------------------------------------------------------------

    Quote:
    Mint = DateDiff("d", "5/09/2007", "11/09/2007")
    Means calculate the day difference between the dates specified.

    ----------------------------------------------------------------

    Quote:
    lstAnswer.AddItem "The day difference = " & Mint
    Simply means add the answer to the LixtBox.

    ----------------------------------------------------------------

    You can also change this:
    Quote:
    Mint = DateDiff("d", "5/09/2007", "11/09/2007")
    The "d" can be changed into other things like:

    Year(s): "yyyy"
    Month(s): "m"
    Week(s): "ww"
    Day(s): "d"
    Hour(s): "h"
    Minute(s): "n"
    Second(s): "s"

    Just replace the "d" with one of those and you're done!

    ALSO you can obviously change the dates to whatever you want!

    Thanks to Tcm9669 for the Screenshot program.

    Thanks to TheComputerMaster for the upgraded Screenshot program.

    Thanks to you for reading this tutorial!

    Made by me, Travy92.


    Lol, Samples!:
    Attached Files<>To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
    __________________
    Quote:
    The pacifist's task today is to find a method of helping and healing which provides a revolutionary constructive substitute for war.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      .NET (8)
      Buttons (3)
      Database Related (7)
      Date and Time (4)
      Development (4)
      Error Handling (3)
      File Manipulation (6)
      Introduction to Visual Basic (24)
      Miscellaneous (3)
      Multimedia (10)
      Networking (10)
      Security (1)
      VB Script (6)

    New

    Hot