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

Zoom in/ Zoom out the content of a RadRichTextBox

4 Answers 301 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 15 Dec 2011, 09:36 PM
Hi,

I would like to know if it is possible to Zoom the whole content of a RadRichTextBox for a given zoom factor (e.g  150%, 200% etc.).

Thanks for your answer.

4 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 20 Dec 2011, 01:01 PM
Hello Guy,

There are several approaches to allow zooming in/out in with RadRichTextBox. The most easy way would be to add RadRichTextBoxStatusBar control to your UI, which will provide zooming slider out of the box:

<telerik:RadRichTextBoxStatusBar AssociatedRichTextBox="{Binding ElementName=radRichTextBox1, Mode=OneTime}"/>
We are using this control in our online demo:
http://demos.telerik.com/silverlight/#RichTextBox/TelerikEditor

Generally to zoom RadRichTextBox view in/out you should change the dependency property ScaleFactor, which takes Size with values from 0 to 1 to zoom out and > 1 to zoom in - (1,1) is the default value meaning no zoom would be applied.

Kind regards,
Mike
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Guy
Top achievements
Rank 1
answered on 21 Dec 2011, 05:07 PM
Hello Boby,

Thank you for your great support. I added successfully the Zoom in/out feature to my richtextbox.
Best regards,

Guy 
0
Rabin
Top achievements
Rank 1
answered on 29 Apr 2013, 07:04 PM
Hello ,

You mentioned there are another ways for zooming in/out  for radrichtextbox, Can you please provide me another examples,  Do you have seperate commandbindings for it as in the RadPdfViewer.

Like : 



<telerik:RadButton Command="{Binding ZoomInCommand}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsBackgroundVisible="False">
                        <ToolTipService.ToolTip>
                            <TextBlock Text="Zoom in" />
                        </ToolTipService.ToolTip>
                        <Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/zoom-in.png" Stretch="None" />
                    </telerik:RadButton>

                    <telerik:RadButton x:Name="PART_btnZoomOut" Command="{Binding ZoomOutCommand}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsBackgroundVisible="False">
                        <ToolTipService.ToolTip>
                            <TextBlock Text="Zoom out" />
                        </ToolTipService.ToolTip>
                        <Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/zoom-out.png" Stretch="None" />
                    </telerik:RadButton>

                    <telerik:RadComboBox IsEditable="True" Margin="2" MaxWidth="95" SelectedIndex="4" x:Name="cbScale" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                                 Text="{Binding FixedDocumentViewer.ScaleFactor, Converter={StaticResource doubleToStringPercentConverter}, Mode=TwoWay}">
                        <telerik:RadComboBoxItem Content="10%" />
                        <telerik:RadComboBoxItem Content="25%" />
                        <telerik:RadComboBoxItem Content="50%" />
                        <telerik:RadComboBoxItem Content="75%" />
                        <telerik:RadComboBoxItem Content="100%" />
                        <telerik:RadComboBoxItem Content="150%" />
                        <telerik:RadComboBoxItem Content="200%" />
                        <telerik:RadComboBoxItem Content="500%" />
                        <telerik:RadComboBoxItem Content="1000%" />
                      
                    </telerik:RadComboBox>
          


Thanks,
Rabin
0
Mihail
Telerik team
answered on 02 May 2013, 01:25 PM
Hello Rabin,

Thank you for writing.

You can use the ScrollToVerticalOffset and ScrollToHorizontalOffset methods of RadRichTextBox to scroll to appropriate offset.

I hope this helps.

Regards,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Guy
Top achievements
Rank 1
Answers by
Mike
Telerik team
Guy
Top achievements
Rank 1
Rabin
Top achievements
Rank 1
Mihail
Telerik team
Share this question
or