Results 1 to 6 of 6

Thread: [VB2005] Random fact generator/birthday generator

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    3

    [VB2005] Random fact generator/birthday generator

    I wana make a vb program where on one page it generates facts from a text file to a text box by the click of a button (randomly) and also a separate page where u can select day & month to display corresponding famous birthdays from a text file.

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [VB2005] Random fact generator/birthday generator

    Welcome to the forums.

    Are you just telling us what you're up too, or do you have some kind of question?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    3

    Re: [VB2005] Random fact generator/birthday generator

    my apologies! i am new to using visual basic and would like to know how to make this program!
    thank you.

  4. #4
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fox, OK
    Posts
    381

    Re: [VB2005] Random fact generator/birthday generator

    Randomly....
    Read the facts into an array. Pick a random number n from 0 to Array.UpperBound.
    Display ArrayItem(n) in the TextBox.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    3

    Re: [VB2005] Random fact generator/birthday generator

    Quote Originally Posted by DroopyPawn
    Randomly....
    Read the facts into an array. Pick a random number n from 0 to Array.UpperBound.
    Display ArrayItem(n) in the TextBox.
    ok, ive put a random number generator in there, how can i convert it so instead of showing up numbers it shows up a line from the txt file? (each fact is on a line).


    also, how can i do my birthday generator? I want to be able to do it from two drop down boxes to select day and month to display a birthday in a text box from a txt file.

  6. #6
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fox, OK
    Posts
    381

    Re: [VB2005] Random fact generator/birthday generator

    You need to read the text into the array, not the numbers. Then create one random number. Display arrayitem(number) to show the randomly selected text.

    There are several ways to do the birthday part. But I'm wondering, if you should use a DatePicker control rather than ComboBoxes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width