This is a migrated thread and some comments may be shown as answers.

SelectionMiniToolBar - How to

4 Answers 96 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Curtis asked on 12 Oct 2020, 09:13 PM

Hello :)

 

Currently the SelectionMiniToolBar appears very transparent with its opacity increasing as the user moves the mouse over it - my problem is the RTF control has a white background and this menu has a white background with no border so visually it looks like it bleeds onto the page - its not of course, it's floating above it but i'd like to add a BORDER to the Mini Tool Bar so it's more recognizable.

 

So now i'm looking for where the SelectionMiniToolBar is referenced and that has me stumped.   rtfControl.SelectionMiniToolBar isn't correct (I sort of knew that going in but it's where i started) so my question is this:  How do I add a border to the existing SelectionMiniToolBar or do i have to build my own completely separate menu in order to do this?

 

Kindest regards, 

Curtis

 

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Oct 2020, 11:27 AM

Hello, Curtis,   

SelectionMiniToolBar is a derivative of ShapedForm. You can use the following code snippet in order to enable its border:

        public RadForm1()
        {
            InitializeComponent();

            this.radRichTextEditor1.IsSelectionMiniToolBarEnabled = true;
            ShapedForm form = this.radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar as ShapedForm;
            form.BorderWidth = 2;
            form.BorderColor = Color.Red;
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 21 Oct 2020, 04:25 AM

This was perfect, Dess!  Thank you very much :)

Is there any way to change the shape into a rectangle instead of a window with rounded corners?  I've never used the Shape Editor but i dont think i can get at it for this popup so if i'm wrong there, your advice would be terrific

Kindest regards, 

Curtis

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Oct 2020, 01:29 PM

Hello, Curtis, 

Changing the shape of the SelectionMiniToolBar is as simple as changing the shape of a form: 

            this.radRichTextEditor1.IsSelectionMiniToolBarEnabled = true;
            ShapedForm form = this.radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar as ShapedForm;
            form.BorderWidth = 1;
            form.BorderColor = Color.Red;
            form.Shape = new RoundRectShape(0); 

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 21 Oct 2020, 04:57 PM

That is so perfect i have nothing more to say on the subject except "Thank you again for a great help, Dess!" :)

 

Tags
RichTextEditor
Asked by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or