FontStyle Object

Applies to TestComplete 14.70, last modified on April 22, 2021

Description

The FontStyle object represents a collection of font styles that can be used to display the message in the test log. To get the FontStyle object, access the LogParams.FontStyle property.

Members

Example

The code below demonstrates how you can use the FontStyle object to specify the Bold font style for the messages posted to the test log when an unexpected window appears.

JavaScript, JScript

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)
{
  LogParams.MessageText = "An unexpected window has appeared.";
  // Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " + Window.Name + " window has appeared.";
  // ...
  LogParams.Priority = pmHighest;
  LogParams.FontStyle.Bold = true;
  // ...
  // Specifies the color settings
  LogParams.FontColor = clSilver;
  LogParams.Color = clFuchsia;
}

Python

def EventControl1_OnUnexpectedWindow(Sender, Window, LogParams):
  LogParams.MessageText = "An unexpected window has appeared."
  # Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " + Window.Name + " window has appeared."
  # ...
  LogParams.Priority = pmHighest
  LogParams.FontStyle.Bold = True
  # ...
  # Specifies the color settings
  LogParams.FontColor = clSilver
  LogParams.Color = clFuchsia

VBScript

Sub EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)

  LogParams.MessageText = "An unexpected window has appeared."
  ' Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " & Window.Name & " window has appeared."
  ' ...
  LogParams.Priority = pmHighest
  LogParams.FontStyle.Bold = True
  ' ...
  ' Specifies the color settings
  LogParams.FontColor = clSilver
  LogParams.Color = clFuchsia
  
End Sub

DelphiScript

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams);
begin
  LogParams.MessageText := 'An unexpected window has appeared.';
  // Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText := 'The ' + Window.Name + ' window has appeared.';
  // ...
  LogParams.Priority := pmHighest;
  LogParams.FontStyle.Bold := True;
  // ...
  // Specifies the color settings
  LogParams.FontColor := clSilver;
  LogParams.Color := clFuchsia;

end;

C++Script, C#Script

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)
{
  LogParams["MessageText"] = "An unexpected window has appeared.";
  // Specifies the string that will be posted to the Details panel
  LogParams["AdditionalText"] = "The " + Window["Name"] + "window has appeared.";
  // ...
  LogParams["Priority"] = pmHighest;
  LogParams["FontStyle"]["Bold"] = true;
  // ...
  // Specifies the color settings
  LogParams["FontColor"] = clSilver;
  LogParams["Color"] = clFuchsia;
}

See Also

LogParams Object

Highlight search results