You're missing knowledge of the difference between an array and an ArrayList. I can't really tell what you're trying to accomplish with this piece of code, but you probably want either of these:
Dim rate(17) As Double
or
Dim rate As ArrayList = New ArrayList() 'Then rate.Add(etc etc)
Dim myPrintDialog As New PrintDialog()
Dim mySettings As New Drawing.Printing.PrinterSettings()
mySettings.PrintRange = Drawing.Printing.PrintRange.Selection
myPrintDialog.AllowSelection = True
myPrintDialog.PrinterSettings = mySettings
myPrintDialog.ShowDialog()
It ought to loop however many times there are controls in the groupbox. I see no code for counting the number of loops, so how do you know. You step through it?
The command and args that would normally be passed will probably be members of the e that is passed to the function. Type e. and see what members are listed. I'm surprised the code didn't cause an error since you were trying to refer to "args" which doesn't exist. Maybe you turned Option Explicit off or something.
Don't bother bumping, it only irritates people. Your best bet might be what I already said, there isn't a way of getting a true measurement of pixels/inch from a screen unless you know the size of the screen.
I'm glad you solved your problem, but don't forget you don't need two New assignments. You could probably get rid of the New from your declare at the top of the form code.