Question Calculating the largest value of A

Snowflake

Member
Joined
Sep 16, 2014
Messages
15
Programming Experience
Beginner
I am not sure if I have working on this too long, but I can not see a better way of finding the largest value of A, can you help?

For your information
  • The size of the form can change
  • Grid is a 2 dimensional array of squares which are drawn onto the window

VB.NET:
Private Function CCC() As Short 
Dim A As Short
For A = 100 To 1 Step -1
If A * Grid.GetLength(1) < Me.Height And A * Grid.GetLength(0) < Me.Width Then Exit For
Next
Return A
End Function
 
Back
Top