How can I get a random number (1-6) Using Visual Basic for Windows Phone? Everything I have tried already has resulted in errors. Here’s an example of some code that has been producing errors:
Randomize()
Dim randnum As Integer = CInt(Int((6 * Rnd()) + 1))
“‘Randomize’ is not declared. Function has moved to the ‘Microsoft.VisualBasic’ namespace.”
“‘Int’ is not declared. It may be inaccessible due to its protection level.”
“‘Rnd’ is not declared. Function has moved to the ‘Microsoft.VisualBasic’ namespace.”
What do I need to do? The same code works fine in Visual Basic. Thanks.
The
RandomClass is supported in Phone 7.x