bladernr
March 20th, 2005, 08:24 PM
Can someone help me with a problem with fontdialog?? It is my understanding that the font dialog when used with a Rich Text Box does one of two things depending on selection of text.
1. If text is selected, the font dialog will change the font of the selected text using the selectionfont property
2. if text is not selected, the font will be changed from the insertion point onward.
The problem I am running in to is that if the selected text is at the end of a line, the font is changed for both the selection AND any text added afterwards.
example:
This is in the default font for the box
This is in the default font and THIS IS CHANGED to a new font property
This is in the default font and WHEN I SELECT THIS
all other text after the selection ALSO includes the selectionfont format.
thats basically how it is working. I gather that the problem is that when one selects text at the end of the text in the RichTextBox the insertion pointer is also included in that selection.
Is there any way to move the insertion point outside the selection, or do something so that If the user selects text at the end of the file, changes the font, and then adds more text, the text after the selection that was changed would be in the default font for the Rich Text Box...
hrmmm did that make sense? :-)
Jeff
1. If text is selected, the font dialog will change the font of the selected text using the selectionfont property
2. if text is not selected, the font will be changed from the insertion point onward.
The problem I am running in to is that if the selected text is at the end of a line, the font is changed for both the selection AND any text added afterwards.
example:
This is in the default font for the box
This is in the default font and THIS IS CHANGED to a new font property
This is in the default font and WHEN I SELECT THIS
all other text after the selection ALSO includes the selectionfont format.
thats basically how it is working. I gather that the problem is that when one selects text at the end of the text in the RichTextBox the insertion pointer is also included in that selection.
Is there any way to move the insertion point outside the selection, or do something so that If the user selects text at the end of the file, changes the font, and then adds more text, the text after the selection that was changed would be in the default font for the Rich Text Box...
hrmmm did that make sense? :-)
Jeff