Richtextbox (RTB)

K

KG

I have a richtextbox that I use as a text editor.
The font and attributes are set by a toolbar.
When text with multiple fonts applied is selected within the RTB, the
SelectionFont is null (naturally).
Unfortunately this stops any manipulating of other properties such as Bold,
Italic, Size etc..
In the VB6 version RTB, it had separate SelBold, SelItalic and SelSize
properties which allowed manipulation of these properties regardless of the
font.
How can this be accomplished in .NET?

Cheers
KG
 
M

Morten Wennevik

Hi KG,

I fear you may have to make your own dialog for this. The separate fonts are listed in the SelectedRtf property and it should be possible to extract the various fonts from it. If more than one font show Bold/Italic dialog with the option to go on to a FontDialog.


Happy coding!
Morten Wennevik [C# MVP]
 
K

Kevin Yu [MSFT]

Hi KG,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the information for
Bold, Italic and Size from the RichTextBox selection when multiple fonts
are applied to the selection. If there is any misunderstanding, please feel
free to let me know.

As far as I know, when the SelectionFont property returns null if multiple
fonts are applied to the current selection, we cannot get the information
for Bold, Italic and Size, because these information are a part of the
font. Since the font cannot be get, they cannot be get.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top