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

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

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 12 Mar 2012, 07:04 PM

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>

 

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 15 Mar 2012, 04:39 PM
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 >>
Tags
General Discussions
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or