Help for RandomInt function

i have drawn Rectangle and i want to randomly move the dot inside that rectangle.
i have draw the rectangle using command
i have taken RandomInt method
Dim x As Integer = Xojo.Math.RandomInt(1, g.Width)
Dim y As Integer = Xojo.Math.RandomInt(1,g.Height)
g.ForeColor = &cff0000 // Red
g.FillRect(x, y, 5, 5)
i want to move the random dot between the rectangle only.

Dim x As Integer = Xojo.Math.RandomInt(0,286)+185
Dim y As Integer = Xojo.Math.RandomInt(0,223)+81