Zoom in/ Zoom out the content of a RadRichTextBox

5 posts, 0 answers
  1. Guy
    Guy avatar
    46 posts
    Member since:
    Nov 2008

    Posted 15 Dec 2011 Link to this post

    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.
  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Guy
    Guy avatar
    46 posts
    Member since:
    Nov 2008

    Posted 21 Dec 2011 Link to this post

    Hello Boby,

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

    Guy 
  5. Rabin
    Rabin avatar
    1 posts
    Member since:
    Dec 2010

    Posted 29 Apr 2013 Link to this post

    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
  6. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 02 May 2013 Link to this post

    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.

Back to Top
DevCraft banner