Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:10:36+00:00 2026-06-01T08:10:36+00:00

<Style x:Key=MyButton TargetType={x:Type Border}> <Style.Resources> <Style TargetType={x:Type TextBlock}> <Setter Property=FontSize Value=24/> <Setter Property=Foreground Value={StaticResource

  • 0
    <Style x:Key="MyButton" TargetType="{x:Type Border}">
        <Style.Resources>
            <Style TargetType="{x:Type TextBlock}">                    
                <Setter Property="FontSize" Value="24"/>
                <Setter Property="Foreground" Value="{StaticResource FontColor}"/>                    
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="Cursor" Value="Hand"/>
                <Setter Property="FontWeight" Value="DemiBold" />
                <Setter Property="Effect">
                    <Setter.Value>
                        <BlurEffect Radius="2" ></BlurEffect>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="FontWeight" Value="ExtraBold" />
                    </Trigger>                                                
                </Style.Triggers>
            </Style>
        </Style.Resources>
    </Style>  

I want to create my own button style that consist of a border and a textblock. How can I add a control to my style? I actually want to add an extra textblock so that I can blur the textbox that is in the back making it look like a glow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:10:38+00:00Added an answer on June 1, 2026 at 8:10 am

    I’m not sure exactly how you want your second blur textblock to look, but the following xaml should get you well on your way to creating the button template you’re after.

    Each textblock, as well as the border, have their own styles so you can style them individually and wrap them all up inside the control template of your button style:

    <Window x:Class="WpfApplication1.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">
    <Window.Resources>
        <Style x:Key="MainTextBlock" TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="24"/>
            <Setter Property="Foreground" Value="Blue"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="FontWeight" Value="DemiBold" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="FontWeight" Value="ExtraBold" />
                </Trigger>
            </Style.Triggers>
        </Style>
    
        <Style x:Key="BlurTextBlock" TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="24"/>
            <Setter Property="Foreground" Value="Blue"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="FontWeight" Value="DemiBold" />
            <Setter Property="Effect">
                <Setter.Value>
                    <BlurEffect Radius="2" ></BlurEffect>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style x:Key="BorderStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="Orange" />
            <Setter Property="BorderThickness" Value="2" />
        </Style>
    
        <Style x:Key="MyButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Style="{StaticResource BorderStyle}">
                            <Grid>
                                <TextBlock Style="{StaticResource MainTextBlock}" Text="{TemplateBinding Content}" />
                                <TextBlock Style="{StaticResource BlurTextBlock}" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Button Style="{StaticResource ResourceKey=MyButton}" Height="30" Width="100" Content="BUTTON" />
    </Grid></Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi everyone i have a xaml code like this <Style x:Key = {x:Type TabItem}
So I have an object full of key-value pairs that describe the intended style
How can I get Emacs style key bindings in Visual Studio? Is it available
in AS2.0 you would include key->val style params in the param embed and object
/* Style 1 */ .myclass { background:#ff0; border:1px solid #ff0 } #myid { width:80px;
I've a file with 2 lines having key, value pair on each line. //
In C# I have custom form of None border style which override onPaint event
GitHub This is the best I can come up with to handle ncurses-style key
I'm trying to iterate over the Style property of a control in ASP.NET. This
Suppose I have a key,value list containing 6 keys and 6 values. I wish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.