|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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 -- -iwdu15 iwdu15 wrote:
Show quoteHide quote > take a.look at Random....ex Yep, it worked.> > 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 > -- > -iwdu15 Thanks for the help! "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: Note that you should create only a single instance of 'Random' in this case:> Private Sub Button1_Click(...) > > Dim rnd As New Random > > Me.Label1.Text = rnd.Next(1, 11) \\\ Private m_Random As New Random() .... Me.Label1.Text = CStr(m_Random.Next(...)) /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Remoting - Some methods hang on certain setups.
VS 2005 form designer major problem Public definitions in module - VS 2005 Dll basic question ThreadPool and DeadLock problems Assign a value to groupbox from a radiobutton contained in groupbo Writing a blank line under an if statement Reading Lines from a File that is in Memory Overwriting a file pass my.application object |
|||||||||||||||||||||||