G Guest Aug 6, 2006 #2 take a.look at Random....ex Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) End Sub i believe the .Next method's parameters are first number = base, bottom number (inclusive) second number = highest number (non inclusive) this will give you a "random" number between 1 and 11 hope this helps
take a.look at Random....ex Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) End Sub i believe the .Next method's parameters are first number = base, bottom number (inclusive) second number = highest number (non inclusive) this will give you a "random" number between 1 and 11 hope this helps
G Geoldr Aug 6, 2006 #3 iwdu15 said: take a.look at Random....ex Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) End Sub i believe the .Next method's parameters are first number = base, bottom number (inclusive) second number = highest number (non inclusive) this will give you a "random" number between 1 and 11 hope this helps Click to expand... Yep, it worked. Thanks for the help!
iwdu15 said: take a.look at Random....ex Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) End Sub i believe the .Next method's parameters are first number = base, bottom number (inclusive) second number = highest number (non inclusive) this will give you a "random" number between 1 and 11 hope this helps Click to expand... Yep, it worked. Thanks for the help!
H Herfried K. Wagner [MVP] Aug 6, 2006 #4 iwdu15 said: Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) Click to expand... Note that you should create only a single instance of 'Random' in this case: \\\ Private m_Random As New Random() .... Me.Label1.Text = CStr(m_Random.Next(...)) ///
iwdu15 said: Private Sub Button1_Click(...) Dim rnd As New Random Me.Label1.Text = rnd.Next(1, 11) Click to expand... Note that you should create only a single instance of 'Random' in this case: \\\ Private m_Random As New Random() .... Me.Label1.Text = CStr(m_Random.Next(...)) ///