```
<Window x:Class="RichTextBoxX.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extwpf="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="Extended WPF Toolkit RichTextBox Test" Height="350" Width="525"
>
<Grid>
<extwpf:RichTextBox />
</Grid>
</Window>
```
__MainWindow.xaml.cs:__
```
public MainWindow()
{
InitializeComponent();
DataContext = this;
}
```
__Exception Detail__
System.FormatException occurred
HResult=-2146233033
Message=Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
InnerException:
__Stack Trace__
mscorlib.dll!System.Number.ParseDouble(string value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) + 0x1dd bytes
mscorlib.dll!System.Convert.ToDouble(string value, System.IFormatProvider provider) + 0x2b bytes
PresentationFramework.dll!System.Windows.Documents.Converters.StringToDouble(string s, ref double d = 0.0) + 0x40 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.XamlParserHelper.ConvertToLineHeight(System.Windows.Documents.ConverterState converterState, string s, ref double d) + 0xb bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.XamlIn.HandleAttributes(System.Windows.Documents.ConverterState converterState = {System.Windows.Documents.ConverterState}, System.Windows.Documents.IXamlAttributes attributes = {System.Windows.Documents.XamlToRtfParser.XamlAttributes}, System.Windows.Documents.DocumentNode documentNode = {System.Windows.Documents.DocumentNode}, System.Windows.Documents.XamlToRtfWriter.XamlTag xamlTag = XTSection, System.Windows.Documents.DocumentNodeArray dna = Count = 0) + 0xc9e bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.XamlIn.System.Windows.Documents.IXamlContentHandler.StartElement(string nameSpaceUri, string localName, string qName, System.Windows.Documents.IXamlAttributes attributes) + 0xdb bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfParser.ParseXTokStartElement(System.Windows.Documents.XamlToRtfParser.XamlToken xamlToken, ref string name = "Section") + 0x49 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfParser.Parse() + 0xa9 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.Process() + 0x14 bytes
PresentationFramework.dll!System.Windows.Documents.XamlRtfConverter.ConvertXamlToRtf(string xamlContent) + 0x54 bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorCopyPaste.ConvertXamlToRtf(string xamlContent, System.IO.Stream wpfContainerMemory) + 0x4f bytes
PresentationFramework.dll!System.Windows.Documents.TextRangeBase.Save(System.Windows.Documents.ITextRange thisRange, System.IO.Stream stream, string dataFormat, bool preserveTextElements) + 0x16a bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.Save(System.IO.Stream stream, string dataFormat) + 0xb bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.Save(System.IO.Stream stream, string dataFormat) + 0xc bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RtfFormatter.GetText(System.Windows.Documents.FlowDocument document = {System.Windows.Documents.FlowDocument}) + 0xb3 bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RichTextBox.UpdateTextFromDocument() + 0x69 bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RichTextBox.EndInit() + 0x6c bytes
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(System.Xaml.XamlType xamlType = {System.Windows.Baml2006.WpfXamlType}, object obj, bool begin) + 0x44 bytes
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_EndInit(MS.Internal.Xaml.Context.ObjectWriterContext ctx) + 0x2a bytes
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndObject() + 0x182 bytes
System.Xaml.dll!System.Xaml.XamlWriter.WriteNode(System.Xaml.XamlReader reader) + 0x58 bytes
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader = {System.Windows.Baml2006.Baml2006Reader}, System.Xaml.XamlObjectWriter xamlWriter = {System.Xaml.XamlObjectWriter}, bool onlyLoadOneNode = false, bool skipJournaledProperties = false, bool shouldPassLineNumberInfo = true, System.Xaml.IXamlLineInfo xamlLineInfo = {System.Windows.Baml2006.Baml2006Reader}, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer = {System.Xaml.XamlObjectWriter}, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack = {MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame>}, System.Windows.Markup.IStyleConnector styleConnector = null) + 0x2a5 bytes
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri = {System.Uri}) + 0x10f bytes
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader = {System.Windows.Baml2006.Baml2006Reader}, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri) + 0x40 bytes
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream = {MS.Internal.AppModel.BamlStream}, System.Windows.Markup.ParserContext parserContext = {System.Windows.Markup.ParserContext}, object parent, bool closeStream = false) + 0x20b bytes
PresentationFramework.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator) + 0x18f bytes
RichTextBoxX.exe!RichTextBoxX.MainWindow.InitializeComponent() Line 1 + 0xb bytes C#
Comments: ** Comment from web user: zfeld75 **
I am getting the exact same error using VS 2010 I get right when I initialize the RichTextBox and when I type anything
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
Here is the call stack of when I type text
> mscorlib.dll!System.Number.ParseDouble(string value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) + 0x1bd bytes
PresentationFramework.dll!System.Windows.Documents.Converters.StringToDouble(string s, ref double d) + 0x66 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.XamlIn.HandleAttributes(System.Windows.Documents.ConverterState converterState, System.Windows.Documents.IXamlAttributes attributes, System.Windows.Documents.DocumentNode documentNode, System.Windows.Documents.XamlToRtfWriter.XamlTag xamlTag, System.Windows.Documents.DocumentNodeArray dna) + 0x1291 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.XamlIn.System.Windows.Documents.IXamlContentHandler.StartElement(string nameSpaceUri, string localName, string qName, System.Windows.Documents.IXamlAttributes attributes) + 0xdd bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfParser.ParseXTokStartElement(System.Windows.Documents.XamlToRtfParser.XamlToken xamlToken, ref string name) + 0x51 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfParser.Parse() + 0xb1 bytes
PresentationFramework.dll!System.Windows.Documents.XamlToRtfWriter.Process() + 0x14 bytes
PresentationFramework.dll!System.Windows.Documents.XamlRtfConverter.ConvertXamlToRtf(string xamlContent) + 0x5c bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorCopyPaste.ConvertXamlToRtf(string xamlContent, System.IO.Stream wpfContainerMemory) + 0x4f bytes
PresentationFramework.dll!System.Windows.Documents.TextRangeBase.Save(System.Windows.Documents.ITextRange thisRange, System.IO.Stream stream, string dataFormat, bool preserveTextElements) + 0x198 bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.Save(System.IO.Stream stream, string dataFormat) + 0xb bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.Save(System.IO.Stream stream, string dataFormat) + 0xc bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RtfFormatter.GetText(System.Windows.Documents.FlowDocument document) + 0xaa bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RichTextBox.UpdateTextFromDocument() + 0x5b bytes
Xceed.Wpf.Toolkit.dll!Xceed.Wpf.Toolkit.RichTextBox.OnTextChanged(System.Windows.Controls.TextChangedEventArgs e) + 0x2d bytes
PresentationFramework.dll!System.Windows.Controls.Primitives.TextBoxBase.OnTextContainerChanged(object sender, System.Windows.Documents.TextContainerChangedEventArgs e) + 0x12c bytes
PresentationFramework.dll!System.Windows.Documents.TextContainer.EndChange(bool skipEvents) + 0xd9 bytes
PresentationFramework.dll!System.Windows.Documents.TextContainer.System.Windows.Documents.ITextContainer.EndChange(bool skipEvents) + 0xb bytes
PresentationFramework.dll!System.Windows.Documents.TextRangeBase.EndChange(System.Windows.Documents.ITextRange thisRange, bool disableScroll, bool skipEvents) + 0x77 bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.EndChange(bool disableScroll, bool skipEvents) + 0x15 bytes
PresentationFramework.dll!System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose() + 0x15 bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorTyping.DoTextInput(System.Windows.Documents.TextEditor This, string textData, bool isInsertKeyToggled, bool acceptControlCharacters) + 0x1b2 bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorTyping.TextInputItem.Do() + 0x20 bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorTyping._FlushPendingInputItems(System.Windows.Documents.TextEditor This) + 0x9b bytes
PresentationFramework.dll!System.Windows.Documents.TextEditorTyping.BackgroundInputCallback(object This) + 0x98 bytes