EDIT: whoops I realized you needed a random number from -.5 to .5
not -5 to 5
There are many ways to do what you are trying to do.
The most straightforward is like this: random.uniform(-.5,.5) Here's an alternate way if you didn't know uniform existed,
requires a bit of math thinking: random.random() - .5
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...