Take the 2-minute tour ×

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.


share|improve this question
really - no answer to this?... that sucks –  Simon_Weaver Jun 8 '09 at 20:19
add comment

3 Answers

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.

share|improve this answer
This should be accepted as the answer. Its not a straight forward method but it works. –  Isuru Nov 6 '12 at 4:06
I followed this advice, except I used a group box. +1 –  contactmatt Jun 10 at 18:50
add comment

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!

share|improve this answer
This is really annoying and there has to be a better way as this doesn't give the true textbox theme. –  grover Mar 31 '09 at 8:26
add comment

I guess this is a little too late, but nonetheless.

You can always use P/Invoke and subclass your RichEdit with UXTheme API that way you can disable/enable it as you wish.

I think CodeProject had an richedit control which used UXTheme/Visual Styles API

Visual Styles UXTheme API may become obsolete or deprecated as Windows 8 is rolling out

share|improve this answer
add comment

Your Answer


