Log in

View Full Version : Looking for an alternative to RichTextBox


Wiggster
02-01-2005, 08:01 PM
Well, not sure if anyone knows the answer, but with people like ctitanic and other wonderful coders here, I figure it's worth a shot.

I'm teaching myself C# within the .NET Compact Framework using VIsual Studio 2005 Beta, and I'm just trying out various programs that I think will help me learn enough to make decent freeware applications. The current one I'm working on is pretty simple; a Dungeons and Dragons Spell database, using a standard XML file to store the information. I want to reconstitute the information for a spell in a textbox, with simple formatting (bold, italics, font size). If this weren't Compact Framework, it'd be easy: put it in a RichTextBox.

But I have no RichTextBox. I just want a simple scrollable textbox with formatting, but that's easier said than done. So far, the only thing I've figured out is to compile that into HTML and load it in a webBrowser. The downside of that is that the browser doesn't have a border on it, so it looks as if it's floating in the form. So I simple put a button behind the webBrowser that's 1 pixel bigger on each side, so it shows the border. The problem is that this doesn't look very pretty (when the scrollbar appears, there's a double border around the top, bottom, and right of the scrollbar), and it's pretty obtuse.

http://www.wiggster.com/pocket/PocketDnDSpellsSShot.gif

Does anyone have a better way to display Rich Text in .NET CF?

Peter Foot
02-05-2005, 12:47 AM
To be honest if the content is read-only I'd say the HTML method was the best option. Pocket PC doesn't natively support a rich text box control hence there isn't a .NET control for it. The other control supported by the platform is the RichInk control although there isn't a built in .NETCF class for this, there is an InkX control at OpenNETCF (www.opennetcf.org/sdf/) but that doesn't work in the Visual Studio 2005 designer currently (designed to plug into Visual Studio 2003).
Normally the html control uses the full width of the screen so it doesn't have an integrated border, although maybe it supports the BorderStyle property (not sure VS2005 is on my other machine).

Peter

Wiggster
02-05-2005, 10:15 AM
To be honest if the content is read-only I'd say the HTML method was the best option. Pocket PC doesn't natively support a rich text box control hence there isn't a .NET control for it. The other control supported by the platform is the RichInk control although there isn't a built in .NETCF class for this, there is an InkX control at OpenNETCF (www.opennetcf.org/sdf/) but that doesn't work in the Visual Studio 2005 designer currently (designed to plug into Visual Studio 2003).
Normally the html control uses the full width of the screen so it doesn't have an integrated border, although maybe it supports the BorderStyle property (not sure VS2005 is on my other machine).

Peter

Thanks, unfortunately, you just confirmed what I thought. I've tried OpenNetCF, and Intelliprog's RichInk (intelliprog.com/netcf/richink.html) class, but both are refusing to even recognize VS 2005 as existing. There's too much in VS 2k5 that I can't seem to live without now (that and I lost the second CD to my VS 2k3 student version, and I can't buy another one), so I'll have to make do.

But thanks, you're probably right about this being better for read-only. It allows me to use any HTMl I want in the data fields, and they'll display properly. Unfortunately, there's no BorderStyle support for the webBrowser class.

Thanks for the response! :D