font size - Forum

Forum Navigation
You need to log in to create posts and topics.

font size

how to translate this code into VisualNeoWin?  /  как перевести этот код в VisualNeoWin?

procedure plusFont;
i:integer;
begin
for i:=0 to Form.ComponentsCount-1 do
TdbLabel(Form.Components[i]).Font.Size := TdbLabel(Form.Components[i]).Font.Size + 1;
end;

@lolo

 

If you need to increase the font of objects, regardless of what size and other properties it had, then you can do it like this (suppose there are three objects). Using this code, first we get the font properties, then we add one item to the font size and overwrite the font properties by changing only its size.

SetVar "[ObjectsCount]" "3"
Loop "1" "[ObjectsCount]" "[i]"
GetObjectInfo "Object[i]" "FontColor" "[FontColor]"
GetObjectInfo "Object[i]" "FontName" "[FontName]"
GetObjectInfo "Object[i]" "FontSize" "[FontSize]"
GetObjectInfo "Object[i]" "FontStyle" "[FontStyle]"
GetObjectInfo "Object[i]" "FontCharSet" "[FontCharSet]"
SetVar "[FontSize]" "[FontSize]+1"
SetObjectFont "Object[i]" "[FontColor]" "[FontName]" "[FontSize]" "[FontStyle]" "[FontCharSet]"
EndLoop

In the attached demo, press the Start button to increase the font by one point.

Uploaded files:
  • You need to login to have access to uploads.
luishp and proforma.guyot have reacted to this post.
luishpproforma.guyot

спасибо!