views:

734

answers:

2

Hi!

I'm working on a WinForms SmartClient application, which uses a lot of RichTextBox controls - some in place of the regular TextBox for various reasons. Unfortunately the RichTextBox draws the ugly Win95 3D border instead of the themed XP or Vista style border.

Does anyone know of a way to apply the themed border to the RichTextBox? I don't mind subclassing them for this purpose.

Thanks!

+1  A: 

Back in the day I had to solve this with a panel where the text box is a component inside and had DockPadding set to 3 or 4 pixels. I'd then style that panel to a single pixel.

I always found this really annoying!

Simon_Weaver
This is really annoying and there has to be a better way as this doesn't give the true textbox theme.
__grover
A: 

This is really a hack but one thing you can do is drop a Panel control onto the page. Give it a BorderStyle of FixedSingle (it will be None by default.)

Drop your RichTextBox into the panel and set the BorderStyle to none. Then set the Dock property of the RichTextBox to Fill.

This will give you a RichTextBox with a flat border.

Loathian