maxforummfv
New member
Hi everybody!
I'm a new member here and ofcourse, I'm a newbie of VB.NET, too.
Well, I am not an English or American..., so I am not good at English, sorry about that.
But I really need help in this situation. I created an VB application by Visual Studio 2008. It called "Random Number".
I want to make that application because I have a girl shoes shop, so I want to make a program show Random product with its price in my computer. That "random number" application is my small first test before I can do that program.
Let's begin my problem, hihi.
As you can see, my application has 4 main parts:
- Lower number (txtLower): This is where I put the Lowest number.
- Higher number (txtHigher): This is where I put the Highest number.
- Button Random Begin (btRandom): button to activate the program.
- Lable Ramdom (lbRandom): this is where the "random number" between Lower and Higher number show up.
I want an application where I can put Lowest and Highest number and then the program will show the random number between them automatically.
So, I make I loop test like this code:
So, as my test code, it means after each 0,5 second, one random number will show up.
But, the problem is it was not. In fact, It wait for the loop end, it show. Means after 5 seconds (cause i use loop from 1 to 10, each time 500 ms), just 1 random number show.
It is not what I want.
So, if you have time, can you please help me to know how to solve that problem.
Thank you so much!
I'm a new member here and ofcourse, I'm a newbie of VB.NET, too.
Well, I am not an English or American..., so I am not good at English, sorry about that.
But I really need help in this situation. I created an VB application by Visual Studio 2008. It called "Random Number".
I want to make that application because I have a girl shoes shop, so I want to make a program show Random product with its price in my computer. That "random number" application is my small first test before I can do that program.
Let's begin my problem, hihi.
Well, this is my application graphic:
![random1.jpg](http://i375.photobucket.com/albums/oo199/congchuatimhoangtu1989/random1.jpg)
As you can see, my application has 4 main parts:
- Lower number (txtLower): This is where I put the Lowest number.
- Higher number (txtHigher): This is where I put the Highest number.
- Button Random Begin (btRandom): button to activate the program.
- Lable Ramdom (lbRandom): this is where the "random number" between Lower and Higher number show up.
I want an application where I can put Lowest and Highest number and then the program will show the random number between them automatically.
So, I make I loop test like this code:
VB.NET:
Private Sub btRandom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btRandom.Click
Dim lower, higher, i As Integer
Dim R As New Random
lower = txtLower.Text
higher = txtHigher.Text
For i = 1 To 10
lbRandom.Text = R.Next(lower, higher)
Threading.Thread.Sleep(500)
Next
End Sub
So, as my test code, it means after each 0,5 second, one random number will show up.
But, the problem is it was not. In fact, It wait for the loop end, it show. Means after 5 seconds (cause i use loop from 1 to 10, each time 500 ms), just 1 random number show.
It is not what I want.
So, if you have time, can you please help me to know how to solve that problem.
Thank you so much!