Hello
I am trying to fix some text when it is being inserted in a richtexteditor but each time I move the caret position to document end the font changes back to default. This is my code:
if (txtCorrections.Text[txtCorrections.Text.Length - 1] == ')' && txtCorrections.Text[txtCorrections.Text.Length - 2] == ' ')
{
txtCorrections.Text = txtCorrections.Text.Remove(txtCorrections.Text.Length - 2, 1);
txtCorrections.Document.CaretPosition.MoveToDocumentEnd();
}
I use this code in a textChanged.
Thank you for help.
Hello everyone, I have successfully changed the scroll bar color of the RadRichTextEditor control. However, no matter how I try to set and modify the color of the button on the scrollbar, it remains white. How can I achieve this? Thank you.
Hi everyone,
I’m currently using RadRichTextEditor to print logs. I have the following scenario:
How can I change the font color for different lines in RadRichTextEditor?
Thank you!
Create new Word-inspired project and add CommandExecuting event handler with the following code:
private void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is Telerik.WinForms.Documents.RichTextBoxCommands.SaveCommand)
{
e.Cancel = true;
var newForm = new MainForm();
newForm.Show();
}
}
When I click on Save quick-button I expect to see new form active and in focus, but what actually happens is that new form is created, gets in focus briefly, and then the old form steals the focus. How can I fix the focus steal? I need new form to be non-modal.
In theory I should be able to do it if I call Show(this) instead of Show(), and in OnShown overload set Owner = null, but even though the active window now is the new form, the keyboard focus is still on old form (type something to see). I suspect there is some OnTimer interference. Do you have an adequate solution?
Hi everyone,
I'm currently working with the RadRichTextEditor control in my C# WinForms application, and I need to customize the colors of the slide and background bar. Could someone guide me on the steps to change these colors? Additionally, if there's a way to achieve this directly through code, I'd greatly appreciate it if you could share a code snippet.
Thank you in advance for your help!
Best regards,
Kevin
I'm opening a Word (docX) document in the rich text editor, and it seems to open with none of the Styles from the original document in it.
So the document formatting looks strange: the default font seems be called '"NSimSum", and heading are in 'Sitka Banner'.
This MAY be linked to a strage thing in the document.StyleDictionary. It doesn't like iterating through the StyleDefintions:
For example
for each Styles.StyleDefintion in document.StylesRepository
...does not work
dim firstStyle as Styles.StyleDefintion in document.StylesRepository.first
...is ok
so I am using:
dim styleDef As Styles.StyleDefinition = document.StyleRepository.ElementAt(i)
...which is OK, but strange
Are these two things connected? Am I missing something ?
Thanks
we are using the RichTextEditor to display a DOCX file. HOwever, I can not for the life of me figure out to remove/close the document once it has been assigned to the Document property on the RichTextEditor control. I know this is probably simple, but I am just not seeing anything like a CLOSE(), EXIT(), CLEAR() and Setting Document = null crashes.
TIA
Mark
Hello,
Telerik have demo Richtexteditor - Document API project example with 3 buttons (bold, italic and underline) . Can you please send me any example or project how to add there two FlowDirection buttons (LTR and RTL) with toggled states as in the first look realization?
Thank you!
Is there a way to hide the File -> New Menu Option?
I tried this but it returns "Nothing" indicating the backstageTabItemNew item wasn't found.... maybe there's another name for it?
Dim FileNewItem As BackstageTabItem = TryCast(Me.RichTextEditorRibbonBar1.RibbonBarElement.BackstageControl.Items("backstageTabItemNew"), BackstageTabItem)
I'm capturing the event below
Private Sub RadRichTextEditor1_CommandExecuting(sender As Object, e As Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs) Handles RadRichTextEditor1.CommandExecuting
If TypeOf e.Command Is SaveCommand Then
If e.CommandParameter = "pdf" Then
'allow export to pdf
Else
e.Cancel = True
End If
End If
End Sub
I was hoping to find
If TypeOf e.Command Is SaveASCommand - but from what I can see, that doesn't exist.
The problem is - if the user clicks the Save Button or BackStage Save - I'm doing special processing to the database.
But if they click on Save As - It indicates that the user wants to 'export' the document to a pdf or to a word .docx
But in both cases - e.command is always SaveCommand.
It would have been nice to have a (1) SaveCommand and (2) SaveAsCommand
Anyway, is there any event that I can tap into so that these 2 methods can be dealt with differently?
I did add a handler for the SaveButton itself... and that works just fine.
AddHandler RichTextEditorRibbonBar1.QuickAccessToolBarItems(0).MouseDown, AddressOf SaveButton_MouseDown
Maybe you can show me how to create an addhandler for the BackStage Save Menu Option
And
For the BackStage SaveAs Menu Option
That would be of great help and probably solve my special handling needs.