# InputFormat.FontSize Property

> Gets or sets the font's size, in twips, at the current input position. If text is selected, the property specifies the font size of the whole selected text.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > InputFormat.FontSize Property
- **752 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/fontsize-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/fontsize-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/fontsize-property/llms-full.txt

---

### Description

Gets or sets the font's size, in twips, at the current input position. If text is selected, the property specifies the font size of the whole selected text.

### Syntax

```csharp
public int? FontSize { get; set; }
```

```vbnet
Public Property FontSize As Integer?
```

### Examples

The following XAML example binds the FontSize property to a text box. The size is converted to Point:

```plaintext
…
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
…
<Window.Resources>
    <tx:MeasureConverter Unit="Point" Decimals="1" x:Key="twipsconv" />
</Window.Resources>
…
<TextBox 
    Height="21" 
    Name="textBoxFontSize" 
    Text="{Binding ElementName=textControl1,
        Path=InputFormat.FontSize,
        Converter={StaticResource twipsconv},
        Mode=TwoWay}"/>
```

The following example changes the formatting applied to text entered at the end of a document by using `InputFormat.FontSize`.

```csharp
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;

inputFormat.FontSize = 10;
if (inputFormat.FontSize != null)
{
    Console.WriteLine("Input Format: Font Size is available.");
}
```

```vbnet
textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat

inputFormat.FontSize = 10
If inputFormat.FontSize IsNot Nothing Then
    Console.WriteLine("Input Format: Font Size is available.")
End If
```

### Remarks

The property returns null when the text selection contains multiple characters with mixed font sizes.

The [WPF.MeasureConverter](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/measureconverter/llms-full.txt) can be used to convert the property value to another measuring unit.

---

## Nearby

- **Previous:** [InputFormat.FontFamily Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/fontfamily-property/llms-full.txt)
- **Next:** [InputFormat.FrameFillColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/framefillcolor-property/llms-full.txt)
