Rich Text Box
-
Hi All I am having propblems moving from the vb6 version Rich Text Box (RTB) to the .NET one. 1. The .NET version RTB seems to have stripped a lot of the properties and moved them to the font property. This is a problem when you have multiple fonts selected and can no longer access these previous properties independently. The properties are: * SelSize (The font size of the selection) * SelBold (Whether the selection is bold or not) * SelItali (Whether the selection is italic or not) I can retrieve these properties by regexing the actual Rich Text but I would have thought there was an easier way.:( TIA JB Not Bitter, Just Twisted
-
Hi All I am having propblems moving from the vb6 version Rich Text Box (RTB) to the .NET one. 1. The .NET version RTB seems to have stripped a lot of the properties and moved them to the font property. This is a problem when you have multiple fonts selected and can no longer access these previous properties independently. The properties are: * SelSize (The font size of the selection) * SelBold (Whether the selection is bold or not) * SelItali (Whether the selection is italic or not) I can retrieve these properties by regexing the actual Rich Text but I would have thought there was an easier way.:( TIA JB Not Bitter, Just Twisted
Would the following work for you?
Font regularFont = this.richTextBox1.Font;
Font boldFont = new Font(regularFont, FontStyle.Bold);
Font italicFont = new Font(regularFont, FontStyle.Italic);// instead of SelBold
this.richTextBox1.SelectionFont = boldFont;// instead of SelItali
this.richTextBox1.SelectionFont = italicFont;... and so on
#include "witty_sig.h"