Version

Changing Font And Styles (xamSyntaxEditor)

Topic Overview

Purpose

This topic provides information on how to change the presention of the document’s content inside the xamSyntaxEditor™ .

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this topic, you will find information to help you better understand the xamSyntaxEditor’s functions.

This topic covers the text editing capabilities of the xamSyntaxEditor control from both the developer and user’s perspective.

Control Configuration Summary

Control configuration summary chart

The following table lists the configurable aspects of the xamSyntaxEditor’s editing view.

Configurable aspect Description Property

Changing Background

You can change the background by applying different brushes and colors using this property.

Changing Font Family

You can change the font family using this property.

Changing Font Size

You can change the font size using this property.

Changing Font Style

You can change the font style using this property.

Changing Font Weight

You can change the font weight using this property.

Changing Zoom

You can change the zoom level using this property

Note
Note

To change the foreground color please refers to the Changing Default Classification Types Appearance topic.

Changing Background

Overview

You can change the background by applying different brushes and colors using this property.

Property settings

The following table maps the desired property settings configuration.

In order to: Use this property: And set it to:

Change the background of the xamSyntaxEditor editing area

Background

An instance of Brush

Code

In C#:

this.xamSyntaxEditor1.Background = new SolidColorBrush(Colors.Yellow);

In Visual Basic:

Me.xamSyntaxEditor1.Background = New SolidColorBrush(Colors.Yellow)

Changing Font Family

Overview

You can change the font family using this property.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Change the font family used by the xamSyntaxEditor

FontFamily

An instance of FontFamily

Code

In C#:

this.xamSyntaxEditor1.FontFamily = new FontFamily("Arial");

In Visual Basic:

Me.xamSyntaxEditor1.FontFamily = New FontFamily("Arial")

Changing Font Size

Overview

You can change the font size using this property.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Change the font size used by the xamSyntaxEditor

FontSize

A positive value of the double type.

Code

In C#:

this.xamSyntaxEditor1.FontSize = 12;

In Visual Basic:

Me.xamSyntaxEditor1.FontSize = 12

Changing Font Style

Overview

You can change the font style using this property.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Change the font style used by the xamSyntaxEditor

FontStyle

A value of type FontStyles.

Code

In C#:

this.xamSyntaxEditor1.FontStyle = FontStyles.Italic;

In Visual Basic:

Me.xamSyntaxEditor1.FontStyle = FontStyles.Italic

Changing Font Weight

Overview

You can change the font weight using this property.

Property settings

The following table maps the desired property settings configuration.

In order to: Use this property: And set it to:

Change the font weight used by the xamSyntaxEditor

FontWeight

A value of type FontWeights.

Code

In C#:

this.xamSyntaxEditor1.FontWeight = FontWeights.Bold;

In Visual Basic:

Me.xamSyntaxEditor1.FontWeight = FontWeights.Bold

Changing Zoom

Overview

You can change the zoom level using this property.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Change the zoom used by the xamSyntaxEditor

ZoomLevel

A positive value of type double and with a range from 0.2 to 4.0 that represents the scaling factor applied to the document text when rendered. For example, the default zoom level of 1.0 will display document text at its ‘normal’ size based on the current setting of the FontSize property. A setting of 2.0 will display the text with a scaling factor that doubles the size of the text.

In C#:

this.xamSyntaxEditor1.ZoomLevel = 2.5;

In Visual Basic:

Me.xamSyntaxEditor1.ZoomLevel = 2.5

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information on how to change the colors and other appearance attributes assigned to language elements by the xamSyntaxEditor .

This topic explains the current line highlighting feature.

This topic describes the use and configuration of the xamSyntaxEditor control’s built-in Line Number Margin.

This topic will help you understand the document splitting capability of the xamSyntaxEditor and how to customize it.