Determine System Text Size

//Make a new label and format it Dim MyLabel as new Label MyLabel.TextFont = "SmallSystem" MyLabel.Text = "SmallSystem Text" //Check the size Dim MyTextSize as Integer MyTextSize = MyLabel.TextSize If MyTextSize = 0 then //Is size system default? MyTextSize = Graphics.TextSize //Get Size Else MyTextSize = MyLabel.TextSize //Get other size End If msgbox "Small System Text Size is: " + CStr(MyTextSize)
The system text size is usually set to a default value of 0, which allows the OS to select the appropriate default size. To get the size of the default text then use the Graphics.TextSize command.

3 Responses

I did not realize Window had a Graphics property. This does not seem documented either in the Window LR or the Graphics LR. And, although since it is not documented it may not be used often, but if one sets Graphics.TextSize to another value, then your method delivers the wrong value. This should probably be used only on a new window with no previous setting of Graphics.TextSize.
Also, I tried to get Graphics.TextFont and it is "".
OK. After posting a request to have documentation updated, I found out Window.Graphics has been deprecated back in 2011R4.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.