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

SelectionMiniToolbar customization issues

1 Answer 109 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Riccardo
Top achievements
Rank 1
Riccardo asked on 05 Nov 2015, 08:14 AM

Hello,

I'm trying to create a custom SelectionMiniToolbar but I am encountering several issues.

I've tried some examples found here but I still have problems.

First of all I'm unable to remove the Title Bar from the RadRichTextBoxWindow and also I'm unable to position correctly the Window to appear where the default SelectionMiniToolbar would appear.

I would really like to have an example that shows how to declare a custom SelectionMiniToolbar and how to position it correctly as the default toolbar does.

Right now all the code that I have is:

RichTextBoxFormatToolbar.xaml 

01.<richTextBoxUI:RadRichTextBoxWindow x:Class="Views.RichTextBoxFormatToolbar"
03.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
04.             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
05.             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
06.             xmlns:richTextBoxUI="clr-namespace:Telerik.Windows.Controls.RichTextBoxUI.Dialogs;assembly=Telerik.Windows.Controls.RichTextBoxUI"
07.             ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
08. 
09.    <StackPanel Orientation="Horizontal">
10. 
11.        <Button>Test</Button>
12.         
13.    </StackPanel>
14.     
15.</richTextBoxUI:RadRichTextBoxWindow>

RichTextBoxFormatToolbar.xaml.cs

01.[CustomSelectionMiniToolBar]
02.  public partial class RichTextBoxFormatToolbar : RadRichTextBoxWindow, ISelectionMiniToolBar
03.  {
04.      public RichTextBoxFormatToolbar()
05.          : base()
06.      {
07.          InitializeComponent();
08.      }
09. 
10.      public void Hide()
11.      {
12.          Owner = null;
13.          Close();
14.      }
15. 
16.      public void SetOpacity(double opacity)
17.      {
18.          Opacity = opacity;
19.      }
20. 
21.      public void Show(Point location, RadRichTextBox radRichTextBox)
22.      {
23.          SetOwner(radRichTextBox);
24.          Show();
25.      }
26.  }

 

Thanks a lot for the help

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 09 Nov 2015, 11:28 AM
Hi Riccardo,

I suggest you modifying the  SelectionMiniToolBar style in order to achieve the desired approach. This way you will have no issue with positioning and you can change it in the way you need to.

I've attached a sample project with this approach. Please note that the project used implicit styling approach(NoXaml binaries) and Office_Black theme.

Regards,
Masha
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Riccardo
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or