sorry guys, but what is the code if when button1 is clicked and it randomly picks what to say. say i have 3 difference msgboxes. i only want one to show but i want the program to randomly pick which one to show.
is that possible?
Dim randomclass as new Random
Select Case randomclass.next(0,3)
Case 0: msgbox1
Case 1: msgbox2
Case 2: msgbox3
Dim i As Integer
i = Rnd(1) * 3 + 1
Select Case i
Case 1
MsgBox("msg1")
Case 2
MsgBox("msg2")
Case 3
MsgBox("msg3")
End Select
One more thing to keep in mind when working with VS (Visual Studio) is the term Pseudo Random, What Pseudo Random means (in this case) is you will never get a true random number when using Rnd
Ex: Every time you start the program you will notice that the series is always the same.
The work around for that is by calculating a number on your system that is always different (or more different) System Time, Memory Speed , CPU speed, etc.
That's more of a (good to know) piece of information, and has no real baring here as you only need a small number, but the problem will present itself regardless. I will usually add a label starting at 0 (when in need for a "quick" fix) and have it's number increase by 1 every second and make calculations based off that number to ensure a more random result.