DrDamnit
asked on
How do I use a RichTextBox
The easy one to use is the one that works right out of the box: System.Windows.Forms.RichT extBox. The one I need to use is System.Windows.Controls.Ri chTextBox.
I have a System.Windows.Forms.RichT extBox in my program, but need to convert it to a System.Windows.Controls.Ri chTextBox because it has the ability to do spell check (http://rdsrc.us/pWeOTh).
I have all the references, and I can create the RichTextBox, but I cannot figure out how to actually get it on the form.
How do I get this new RTB on the form so I can use it?
I have a System.Windows.Forms.RichT
I have all the references, and I can create the RichTextBox, but I cannot figure out how to actually get it on the form.
Dim x As New RichTextBox
x.SpellCheck.IsEnabled = True
x.Width = 200
x.Height = 200
x.Visibility = Visibility.Visible
How do I get this new RTB on the form so I can use it?
*Set a Location if desired:
x.Location = New Point(25, 50)
x.Location = New Point(25, 50)
ASKER
Idle_Mind:
Tried me.controls.add(), it is the wrong type:
Error 1 Value of type 'System.Windows.Controls.R ichTextBox ' cannot be converted to 'System.Windows.Forms.Cont rol'. C:\Users\michael\Documents \Visual Studio 2010\Projects\ComposerPad\ ComposerPa d\Form1.vb 112 25 ComposerPad
lcoation doesn't work either:
Error 1 'location' is not a member of 'System.Windows.Controls.R ichTextBox '. C:\Users\michael\Documents \Visual Studio 2010\Projects\ComposerPad\ ComposerPa d\Form1.vb 112 9 ComposerPad
Tried me.controls.add(), it is the wrong type:
Error 1 Value of type 'System.Windows.Controls.R
lcoation doesn't work either:
Error 1 'location' is not a member of 'System.Windows.Controls.R
Ah!...sorry. I wasn't paying attention very closely.
The System.Windows.Controls.Ri chTextBox is a WPF control. It can't be used in a WinForms app. If you really need that control then build a WPF application.
*WinForms and WPF applications are completely different beasts! =\
The System.Windows.Controls.Ri
*WinForms and WPF applications are completely different beasts! =\
ASKER
Oh crap.
Does that mean I have to RE-BUILD the ENTIRE application as a WPF application?
Can I copy / paste the controls from one to the other?
Is this a major undertaking?
Does that mean I have to RE-BUILD the ENTIRE application as a WPF application?
Can I copy / paste the controls from one to the other?
Is this a major undertaking?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Stupid spell check.
The Form:
Me.Controls.Add(x)
A Panel:
Panel1.Controls.Add(x)
Etc....