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

Envelopes with a window

2 Answers 20 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 06 Feb 2012, 10:39 AM
Our users use - when sending letters - envelopes with a window where you can read name and address.
To help them to write the name and address on the right place I can show a rectangle in the background of the RadTextBox.
The question is: what is the best way to skrew this feature/style on and off?
Or... do you know a better way to show/hide such a rectangle?

<telerik:RadRichTextBox x:Name="editor" AllowDrop="True" Drop="EditorDrop" ShowComments="False" FontFamily="Calibri" FontSize="11">
            <telerik:RadDocument LayoutMode="Paged" />
            <telerik:RadRichTextBox.Resources>
                <Style TargetType="telerik:Page">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="telerik:Page">
                                <Grid Background="White">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="50"></ColumnDefinition>
                                        <ColumnDefinition Width="370"></ColumnDefinition>
                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="120"></RowDefinition>
                                        <RowDefinition Height="120"></RowDefinition>
                                        <RowDefinition Height="*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Canvas x:Name="PageContentPresenter" Background="White" />
                                    <Border Grid.Column="1" Grid.Row="1" BorderBrush="Blue" BorderThickness="1" CornerRadius="5" Background="Aqua">
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="HorizontalAlignment" Value="Center" />
                    <Setter Property="VerticalAlignment" Value="Top" />
                </Style>
            </telerik:RadRichTextBox.Resources>
        </telerik:RadRichTextBox>

2 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 09 Feb 2012, 08:29 AM
Hello Rieni,
If I understand your scenario correctly, you can use custom layer which can be dynamically added/removed from the UI, as demonstrated in this demo (the code should be the same for WPF implementation).

Don't hesitate to contact us if you have further questions.


All the best,
Boby
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Rieni De Rijke
Top achievements
Rank 1
answered on 13 Feb 2012, 02:12 PM
Yes, that's it. Thank you for your time!  8-)
Tags
RichTextBox
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Boby
Telerik team
Rieni De Rijke
Top achievements
Rank 1
Share this question
or