When the command button is pressed, I want font size to increase. Currently I have:
Private Sub Command1_Click()
Text1.FontSize = Text1.FontSize + 2
End Sub
This works to a point, but in the fontproperty of my textbox optional fontsizes are 8,10,12,14,18,24. So the font won't increase after 14 (because there is no 16 option).
Rather than having Text1.FontSize + 2, how do I code it so that it moves to the next biggest fontsize?
Private Const comdiafontflagScreen As String = cdlCFScreenFonts
Private Const comdiafontflagPrinter As String = cdlCFPrinterFonts
Private Const comdiafontflagBoth As String = cdlCFBoth
Private Sub Command1_Click()
With CommonDialog1
.Flags = comdiafontflagScreen
.ShowFont
Text1.FontSize = .FontSize
End With
End Sub
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details