# XmlElement.AutoText Property

> Determines whether text is automatically created for a newly added XML element that has no text contents. The created text consists of the element's name enclosed in square brackets and is created only if no text has been set with the XML element's Text property.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 for WPF > Reference > TXTextControl > XmlElement.AutoText Property
- **386 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelement/autotext-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelement/autotext-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelement/autotext-property/llms-full.txt

---

### Description

Determines whether text is automatically created for a newly added XML element that has no text contents. The created text consists of the element's name enclosed in square brackets and is created only if no text has been set with the XML element's Text property.

### Syntax

```csharp
public bool AutoText { get; set; }
```

```vbnet
Public Property AutoText As Boolean
```

### Examples

The following example uses `XmlElement.AutoText` to configure auto text as part of the xml element workflow. The configured value is checked before the workflow continues.

```csharp
xmlElement.AutoText = true;
if (xmlElement.AutoText)
{
    Console.WriteLine("Xml Element: Auto Text is enabled.");
}
```

```vbnet
xmlElement.AutoText = True
If xmlElement.AutoText Then
    Console.WriteLine("Xml Element: Auto Text is enabled.")
End If
```

---

## Nearby

- **Previous:** [XmlElement.AutoSelect Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelement/autoselect-property/llms-full.txt)
- **Next:** [XmlElement Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelement/constructor/llms-full.txt)
