Private Sub CheckSize(TargetView As Object, MultipleLines As Boolean, NumLines As Int) As Boolean
Try
If TargetView = Null Then
Log("SingleLineNoLargerAndPadding")
Return True
End If
Catch
Log("SingleLineNoLargerAndPadding")
Return True
End Try
Dim lbl As Label = TargetView
Try
If MultipleLines Then
Dim txtHeight As Int = su.MeasureMultilineTextHeight(lbl, lbl.Text)
If NumLines > 0 Then
#if DebugX
Log("NumLines:" &NumLines &" txtHeight:" &txtHeight &" lbl.Height:" &lbl.Height &" EachLine:" &(lbl.Height / NumLines) &" TextSize:" &lbl.TextSize)
#end if
If txtHeight <= lbl.Height Or (lbl.Height / NumLines) >= txtHeight Then
Return True
End If
Return False
Else
If txtHeight > lbl.Height Then
Return False
End If
Return True
End If
Else
If cvs.MeasureStringWidth(lbl.Text, lbl.Typeface, lbl.TextSize) > lbl.Width Or _
su.MeasureMultilineTextHeight(lbl, lbl.Text) > lbl.Height Then
Return False
End If
Return True
End If
Catch
Return False
End Try
End Sub