0

I will have to create a Control that supports multiline-copy of text. It looks like this:

Label1:   ContentLine1                       Label2: ContentLine2 (right aligned)
Blah:     ContentLine2                       Hyperlink
Label3:   ContentLine 3 (needs to collapse if no extended info available)

Problems: Mixed styles (bold labels, regular content and hyperlink)

I tried using RTF + FlowDoc with tables. I ultimately gave up after many problems (like no autosizing columns in flowdoc) at the hyperlink I could not get to work. I works in normal mode though. Also the visibility thing is complicated in flowdoc. I had to add and remove the last row when I only wanted to hide it.

I am currently thinking about building a customcontrol giving me the selection like in a WORD-Table. You can start in the left upper cell and just roll down to the right side or just select a part.

Things I also tried so far: A stylized DataGrid: worked good for Layout, but copying did not work as expexted.

Single TextBoxes stlyed as labels... doesn't work for more than one at a time.

Does anybody know I can mimic the textbox selection behaviour over multiple controls, like using mousemove / events to do the magic?

Thanks in advance! :)

Gope
  • 1,672
  • 1
  • 13
  • 19
  • Take a look at the [RichTextBox Class](http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=vs.110).aspx) page on MSDN. – Sheridan Jun 10 '14 at 10:14
  • Hello Sheridan, how would that help? I already tested RTF + FlowDoc + Tables... – Gope Jun 10 '14 at 10:29
  • It would help because it's a `TextBox` that enables you to add links and format the text like you requested... it's the best control for the job. It's not my issue if you have decided against using the best controls for the job. – Sheridan Jun 10 '14 at 10:37
  • Well without knowing much about the requirements, that's a bold point. Do you know about table-column sizing isues and hyperlinks in Flow-Doc Tables? It doesn't work as you think... – Gope Jun 10 '14 at 10:41
  • What is your problem? *without knowing much about the requirements, that's a bold point*... I know as much as you told us, so if that's *not much*, then *you* should have put more requirements into your question. I'm trying to help you here and I can only go by what you told us. You said *I will have to create a Control that supports multiline-copy of text... Problems: Mixed styles (bold labels, regular content and hyperlink)*. A `RichTextBox` will enable you to mix these elements without the need to build a custom control. – Sheridan Jun 10 '14 at 10:49
  • OK, first your right. Sorry that wasn't nice and I aprreciate you taking the time for this. Besides that I already wrote that the FlowDoc implementation does not provide a layout mechanism like WPF. They don't support autosizing (labelcolumn). Aligning text right is also a pain as is using hyperlinks that fire commands. The Copy doesn't work like you would expect inside the Table structure. Besides all that its a massive performance problem. The application is running on a citrix server. FlowDocs (in RTF) are knwon for being permance hogs. So the RichTextBox will not be a good solution. – Gope Jun 10 '14 at 10:56

0 Answers0