Click here to Skip to main content
15,884,099 members
Articles / Programming Languages / C#

Creating Actionlinks in a Silverlight RichTextBox

Rate me:
Please Sign up or sign in to vote.
4.92/5 (5 votes)
28 Mar 2010CPOL6 min read 51.4K   914   18  
Extending the Silverlight RichTextBox so that it supports interactive text
<controls:ChildWindow x:Class="RichNotepad.InsertURL"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="150" FontFamily="Calibri" FontSize="16"
           Title="Insert URL">
  <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="3*" />
            </Grid.ColumnDefinitions>
            <TextBlock HorizontalAlignment="Left" Margin="5" 
                       Text="Target URL:" VerticalAlignment="Center"/>
            <TextBlock HorizontalAlignment="Left" Margin="5" 
                       Text="URL Description:" VerticalAlignment="Center" Grid.Row="1" />
            <TextBox Grid.Column="1" 
                     HorizontalAlignment="Left" Margin="3" x:Name="txtURL" 
                     Width="252" />
            <TextBox Grid.Column="1" Grid.Row="1" 
                     HorizontalAlignment="Left" Margin="3" x:Name="txtURLDesc" 
                     Width="252" />
        </Grid>
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Marc Schluper studied Applied Mathematics at Technical University Eindhoven, The Netherlands.
His employer is Kronos Hiring Solutions in Beaverton, OR.
He is married and has two children.

Comments and Discussions