Telerik Forums
UI for WinForms Forum
1 answer
46 views

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.

                         
Dinko | Tech Support Engineer
Telerik team
 answered on 19 Sep 2024
4 answers
57 views

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.

Kevin
Top achievements
Rank 2
Iron
Iron
 updated answer on 22 Aug 2024
2 answers
131 views

Hi everyone,

I’m currently using RadRichTextEditor to print logs. I have the following scenario:

  • The first line prints "Hello" in black font.
  • The second line prints "world" in red font.

How can I change the font color for different lines in RadRichTextEditor?

Thank you!

Kevin
Top achievements
Rank 2
Iron
Iron
 updated question on 05 Aug 2024
2 answers
64 views

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?

 

Mihajlo
Top achievements
Rank 1
Iron
 answered on 30 Jul 2024
1 answer
103 views

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

Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jul 2024
1 answer
93 views

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

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 09 Apr 2024
1 answer
104 views

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

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Oct 2023
4 answers
84 views

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!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Oct 2023
2 answers
155 views

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)

Nadya | Tech Support Engineer
Telerik team
 answered on 02 Oct 2023
1 answer
84 views

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.

Dinko | Tech Support Engineer
Telerik team
 answered on 13 Sep 2023
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?