Telerik Summer style On Focus Control Need to change the Boarder Thickness

2 posts, 0 answers
  1. Rajesh
    Rajesh avatar
    1 posts
    Member since:
    Oct 2012

    Posted 12 Mar 2012 Link to this post

    Hello Team,

    I am trying to
    FocusVisualStyle to WPF user controls but I am not able to see the effect. Below is the XAML i am using. Please suggest me any other alternative to change the Boarder thickness.

    I need to change focus behavior of the control.

    Thanks for your help and support.

    Thanks & Regards
    Rajesh Penki

    <Window x:Class="TelerikIssueApp.MainWindow"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

            Title="MainWindow" Height="350" Width="525"

            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

        <Grid>       

            <Grid.Resources>

                <Style TargetType="telerik:RadDateTimePicker" x:Key="radDateTimePickerDefaulyStyleNoEnable">

                    <Setter Property="telerik:StyleManager.Theme" Value="Summer"></Setter>

                    <Setter Property="FontSize" Value="11" />

                    <Setter Property="FocusVisualStyle" Value="{DynamicResource AllControlsFocusVisual}"/>

                </Style>

                <Style TargetType="telerik:RadMaskedTextBox" x:Key="radRadMaskedTextBoxDefaulyStyleNoEnable">

                    <Setter Property="telerik:StyleManager.Theme" Value="Summer"></Setter>

                    <Setter Property="FontSize" Value="11" />

                    <Setter Property="FocusVisualStyle" Value="{DynamicResource AllControlsFocusVisual}"/>

                </Style>

                <Style x:Key="AllControlsFocusVisual">

                    <Setter Property="Control.Template">

                        <Setter.Value>

                            <ControlTemplate>

                                <Rectangle Stroke="DeepSkyBlue" StrokeThickness="3" Margin="0,0,0,0"/>

                            </ControlTemplate>

                        </Setter.Value>

                    </Setter>

                </Style>

            </Grid.Resources>

           

            <Grid.RowDefinitions>

                <RowDefinition Height="30" ></RowDefinition>

                <RowDefinition Height="30" ></RowDefinition>

                <RowDefinition Height="30" ></RowDefinition>

            </Grid.RowDefinitions>       

           

            <telerik:RadDatePicker Style="{StaticResource radDateTimePickerDefaulyStyleNoEnable}"

                 Width="180" Height="22" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Grid.Row="0"/>

            <telerik:RadMaskedTextBox   Style="{StaticResource radRadMaskedTextBoxDefaulyStyleNoEnable}"

                Width="180" Height="22" HorizontalAlignment="Left"  
                
    HorizontalContentAlignment="Left" Grid.Row="1"/>       

        </Grid>

    </Window>

     

     

  2. Yana
    Admin
    Yana avatar
    5002 posts

    Posted 15 Mar 2012 Link to this post

    Hello Rajesh,

    You should predefine the templates of both controls in order to customize the FocusVisual style. For RadMaskedTextBox you should search for Border with x:Name="FocusedVisual" and for RadDateTimePicker - x:Name="FocusVisual".

    I've attached a simple example to demonstrate the approach. Hope this helps.

    All the best,
    Yana
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top