First you would create a button (Button1) which will generate a random number each time you press it. Then you create a textbox (TextBox1) that displays the generated random number.
Double-click on the button to go to the code page and enter the Function definition and the contents of the Button1_Click processor.
An example of the code can be copied and pasted. Make sure you understand everything explained in the code.
Example output and code can be found at the following link, look under question id=7008060801335.
http://mathmate.brinkster.net/programming.htm