-3

I have this RichTextBox rtEvents from click-drag in form designer and I want to cast the rtEvents value into string.

This solution doesn't work, because I am not using System.Windows.Controls.RichTextBox

I don't want to use .Windows.Controls.* because its difficult for me to design the form without click-drag.

Is there any other way or workaround for it?

Community
  • 1
  • 1
noobsee
  • 806
  • 15
  • 29

2 Answers2

0

Well, somehow I solved it (not sure if this is the good/perfect way),

By adding using System.Windows.Controls; but I have to add this extra System.Windows.Forms. for all of my objects. For example I have this function:

private void dDownWidth(Combobox cbname)
{
.....
}

Before I add : using System.Windows.Controls; it works like that, but after I add, it have to be like this:

private void dDownWidth(System.WIndows.Forms.Combobox cbname)
{
.....
}

I have to changes it like that for all the objects/parameters objects.

noobsee
  • 806
  • 15
  • 29
0

string richText = new TextRange(rtEvents .Document.ContentStart, rtEvents .Document.ContentEnd).Text;