how can I add a System.Windows.Forms.RichTextBox() to my window or grid. Without having to add a WindowsFormsHost(). Here is my code:
.xaml
<Grid Name="Grid1">
</Grid>
</Window>
.xaml.cs
Host1 = new WindowsFormsHost();
Host1.Margin = new Thickness(8, 12, 3, 3);
Host1.Height = 315;
Host1.Width = 570;
Host1.VerticalAlignment = System.Windows.VerticalAlignment.Top;
Host1.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
richTextBox1 = new System.Windows.Forms.RichTextBox();
richTextBox1.Height = 315;
richTextBox1.Width = 570;
richTextBox1.TextChanged += new EventHandler(richTextBox1_TextChanged);
Host1.Child = richTextBox1;
Grid1.Children.Add(Host1);
I want to remove my Host1 it makes the code too troublesome. How can I add directly to the window the richTextBox1 or directly to the Grid1 the richTextBox1?