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)
2 Answers, 1 is accepted
Hello, Martin,
In order to customize the ribbon bar that is used in RadRichTextEditor control, you should create a custom class that inherits RichTextEditorRibbonBar. You can refer to the following article for more information on this topic: Inherit RichTextEditorRibbonBar - RadRichTextEditor - Telerik UI for WinForms
Please refer to the following code snippet which hides the "New" button:
Class CustomRichTextEditorRibbonBar
Inherits RichTextEditorRibbonBar
Public Sub New()
backstageButtonNew.Visibility = ElementVisibility.Collapsed
End Sub
End Class
I hope this helps. Should you have other questions, I would be glad to help.
Regards,
Nadya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Nadya
I don't want to turn off the entire file menu option - just the Open menu option - I'd like to keep the remaining menu options available. Can you tell me how to just remove the "Open" menu Option?
hi,
Is there a way to hide the File tab? thanks.
Hello, Jenny,
Yes, it is possible to hide the File tab. You can use the following code snippet:
Me.richTextEditorRibbonBar1.RibbonBarElement.ApplicationButtonElement.Visibility = ElementVisibility.Collapsed
Me.richTextEditorRibbonBar1.RibbonBarElement.TabStripElement.ItemContainer.Margin = New System.Windows.Forms.Padding(0)
You can also achieve the same inside your CustomRichTextEditorRibbonBar in case you have such.
I hope this helps. Should you have any other questions do not hesitate to ask.
Hello, Martin,
The File menu in RichTextEditorRibbonBar by default contains the following options:
If I understand you correctly in your first question you asked how to hide the "File -> New " menu option. This is why I show how to remove the backstageButtonNew. In the provided picture in my previous answer only the "New" menu option is missing. The File menu button is not turn off.
In your last post, it seems that you would like to hide the "File -> Open" menu option. Here is how you can achieve this:
Class CustomRichTextEditorRibbonBar
Inherits RichTextEditorRibbonBar
Public Sub New()
backstageButtonOpen.Visibility = ElementVisibility.Collapsed
End Sub
End Class
Here, you can see that the "Open" menu option is missing, the other options are still available:
Please let me know if I can assist you further.
Regards,
Nadya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
ok, I'm doing something wrong I guess.
In the Form_New() subroutine I have this code
RichTextEditorRibbonBar1 = New CustomRichTextEditorRibbonBar
and in the CustomRichTextEditorRibbonBar class I have the following code: But Both the New and Open options are still visible.
Public Class CustomRichTextEditorRibbonBar
Inherits RichTextEditorRibbonBar
Public Sub New()
MyBase.Initialize()
backstageButtonNew.Visibility = ElementVisibility.Collapsed
backstageButtonOpen.Visibility = ElementVisibility.Collapsed
End Sub
End Class
What am I doing wrong???
Hello, Martin,
I am glad that you managed to fix the problem you had on your end. Do not forget to replace the default ribbon bar with the custom one in order to see the changes.
In case you have any other questions, I would be glad to help.