' Visual Basic Programming
' by Mr. Minich
' Ch. 7 Demo #1
' Purpose - to demonstrate the use of the RGB and RND functions
Option Explicit
Private Sub cmdClick_Click()
' Each time the user clicks the command button, the word Hello is displayed in a random color
' in a random place on the form
Randomize
frmMain.ForeColor = RGB(Rnd() * 255, Rnd() * 255, Rnd() * 255)
frmMain.CurrentX = Rnd() * frmMain.Width
frmMain.CurrentY = Rnd() * frmMain.Height
frmMain.Print "Hello"
End Sub