473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Richtextbox (RTB)

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
Nov 16 '05 #1
2 1489
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]
Nov 16 '05 #2
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."

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rs | last post by:
I am trying to override the keypress fucntion in a form as the following Private Sub rtbInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles...
1
by: JJ | last post by:
I'm trying to create the cut/paste/select all context menu on number of richtextboxes. On the contextmenu.popup handler, I want to find out what control is currently displaying the context menu....
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
2
by: marfi95 | last post by:
Hi all, I am trying to change the color of text that the user sees when they are editing a richtextbox. This is the code I am using in the TextChanged method of RichTextBox control. Dim...
1
by: eBob.com | last post by:
After a lot of debugging effort I have to conclude that it does. Or at least can. I take a substring (RichTextBox.Text.Substring) before setting SelectionStart and after and get a different...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.