locked
The randomise function in vb RRS feed

  • Question

  • Is there a different code to use for when using the randomise function when coding for windows 7 phones as I copied and pasted my code but it just gives errors,  all I want to do is place a random number between 1 and 250 into a textbox thanks in advance
    Saturday, May 14, 2011 8:44 PM

Answers

  • C#

    Random random = new Random();
    int randomNumber = random.Next(1, 250);
    
    

    VB

    Dim random As New Random()
    Dim randomNumber As Integer = random.[Next](1, 250)
    
    
    And put randomNumber in your textbox

    If that's not what you mean, can you provide more information what you have now and what error you get ?

    • Proposed as answer by bart___s Monday, May 16, 2011 12:11 PM
    • Marked as answer by Jesse Jiang Wednesday, May 25, 2011 8:22 AM
    Monday, May 16, 2011 12:10 PM