MZ-Tools Articles Series: HOWTO: Get the text editor font and colors information in a Visual Studio add-in
Although I wrote long time ago an article about EnvDTE.DTE.Properties, it was not until this week that I needed to retrieve font and color information of the text editor of Visual Studio. Basically I am changing the code template editor of my MZ-Tools add-in from black and white to colorized text using a RichTextBox, resembling as much as possible the code editor of VS without using more complex 3rd party products (such as Activepro Syntaxt Editor, which seems excellent) or trying to host the Visual Studio code editor inside a Windows Form.
Here is a new article about this subject and some things that I have encountered.
HOWTO: Get the text editor font and colors information in a Visual Studio add-in
BTW, notice that VS 2005 has a bug (fixed in VS 2008) and the “Comment” foreground color is not returned correctly (although the VS code editor colorizes perfectly). You may want to use the XML Comment or CSS Comment foreground color in this case.