This is a very easy lesson in which we will learn how to generate a random integer.
Hey there, If you would like to check the two previous lessons here is a link for them:
1. http://computersight.com/programming/visual-basic-creating-a-basic-calculator/
2. http://computersight.com/programming/visual-basic-leson-two-creating-a-google-searcher/
Today in this lesson I will show you how to generate a random ineger using visual basic it is a very easy task you do not need any visual basic skills to finish it. This could be very helpful in creating various software like a card game, random file opener (which will be covered later) , or random song player , etc. Here are the simple steps you will need to follow to have this awsome thing finished.
- Add 2 buttons.
- Add a timer.
- Add a textbox.
- Double click button1
- paste the following code; timer1.enabled = true
- Go back and double click button2
- Paste the following code; timer1.enabled = false
- Go back and double click the timer
- Paste the following code
Dim ahmedehababouelnasr As Integer
ahmedehababouelnasr = ahmedehababouelnasr2.Next(1, 99999999)
TextBox1.Text = ahmedehababouelnasr
And you are done!!!
Dim ahmedehababouelnasr2 As New Random
Again, here are the two previous lessons here is a link for them:
1. http://computersight.com/programming/visual-basic-creating-a-basic-calculator/
2. http://computersight.com/programming/visual-basic-leson-two-creating-a-google-searcher/
Bye n cyo











A good read thanks for the share nice work!
A very useful lesson in basic. Thank you for sharing.
Monica.
welcome guys and thank you for your nice comments
Nice guidance. Thanks
Interesting article here
Well done!
a kind of information