views:

336

answers:

2

Is there any light version of richtextbox control? I've got to create like 300+ of them in an app which takes time, memory and slows everything down... All that I need is to have a control that will enable me changing the background/foreground of a part of the text... I'd need that in winforms... anybody know anything about some kind of replacement?

A: 

Is this for a grid, or is it 300 fields on a single-record form? Because if it's for a form I would suggest that there is a problem with your design.

If you need it in a grid, consider a paging solution. A paging solution would allow your users to scroll through the records, and you can still use a rich textbox, because the number of rich textboxes would be limited to the number of records displayed on the current page.

Robert Harvey
yeah, google is useless here - tried that before posting.design is a must - it can't be designed otherwise as it's simulating something like a forum... I can't say too much about it (sorry). And the highlighting the text is also a must so that when you scroll throught that you can find the things you are searching for..
argh
@Argh - See my edit.
Robert Harvey
Unfortunatly I can't change the design as this is already a production app and btw. paging is in many ways bad...
argh
+2  A: 

Is it read-write or read-only? If it's read-only it probably wouldn't be too difficult to code this up yourself. (Plug: I have a control which I can upload somewhere if needed :)

You could use the OnPaint event and use different brushes and pens with Rectangles and Text.

Lucas Jones
read-only, I know that I can code it myself - but I don't have the luxury to spend the time on it... and I've got to intergrate it to actually working solution... if your solution works then hell yeah I'd give it a try :) Is there any PM option in stackoverflow? I don't want to share my email... or you could post it to megaupload.com
argh
I'll see what I can do. I'll upload it now. It's not *brilliant* as it was for my own use - no docs, no designer support - but the designer doesnt seem to be a problem. I'll also write some docs quickly (I've got some free time ATM!)
Lucas Jones
Uploaded to Windows Live SkyDrive - http://cid-ae14082183edb6bb.skydrive.live.com/self.aspx/Software/TextSpanControl.zip (public folder; you don't need an account). I'll post the docs online in a few minutes.
Lucas Jones
The docs arent much - just part of the example code for now.
Lucas Jones
http://cid-ae14082183edb6bb.skydrive.live.com/self.aspx/Software/Using%20TextSpanControl.doc (MS Word format(
Lucas Jones
Plain text - http://pastebin.com/f647cde45
Lucas Jones
Hi, this is not exactly what I need since I've got the always the same text - I just need to change the colors of fg/bg - but I'll look into your control and I'll try to adjust it to my needs. Thx.
argh