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

  • Home
  • SEARCH
  • 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 7940217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:19:23+00:00 2026-06-03T23:19:23+00:00

Basically this is a button existing out of rectangle and several textblocks. The rectangle

  • 0

Basically this is a button existing out of rectangle and several textblocks. The rectangle Fill is representing the background of my button. How can i change this when the button is pressed?

The background also has to stay in that color after pressing the button. This basically shows the user visually what buttons have been pressed and what not.

Part of my Style:

<Style x:Key="ButtonStyleReg" TargetType="{x:Type myClasses:RegButton}">
<Setter Property="Template">
    <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
            <Grid x:Name="regButton">
                <Rectangle Name="rectangleBtn" Fill="#FF89959A" Height="Auto" RadiusY="15" RadiusX="15" Stroke="White" Width="Auto"/>                                             
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsFocused" Value="True"/>
                <Trigger Property="IsDefaulted" Value="True"/>
                <Trigger Property="IsPressed" Value="True" >
                    <Setter TargetName="rectangleBtn" Property="Fill" Value="Blue" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False"/>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Setter.Value>
</Setter>
<Setter Property="FontSize" Value="10.667"/>

  • 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-03T23:19:26+00:00Added an answer on June 3, 2026 at 11:19 pm

    You must address the correct element, try giving the rectangle a name and pointing the setter to it by name reference:

    <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid x:Name="regButton">
                        <Rectangle Fill="#FF89959A"
                                   x:Name="rect"
                                   Height="Auto"
                                   RadiusY="15"
                                   RadiusX="15"
                                   Stroke="White"
                                   Width="Auto" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused"
                                 Value="True" />
                        <Trigger Property="IsDefaulted"
                                 Value="True" />
                        <Trigger Property="IsPressed"
                                 Value="True">
                            <Setter Property="Background"
                                    TargetName="rect"
                                    Value="Blue" />
                            <!--??-->
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False" />
                    </ControlTemplate.Triggers>
                </ControlTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button that basically looks like this: <Button android:id=@+id/admin_new_questions android:layout_width=fill_parent android:layout_height=wrap_content android:text=See
The criteria is basically this: folders will exist for about 24-48hrs folders names can
Basically what this does is fadeIn pre-existing divs and then loads an image. When
Basically this is a question how to access local scope handler. I trying to
So basically this code was working fine before. I had some computer issues and
The problem is basically this, in python's gobject and gtk bindings. Assume we have
i'm studying this source base . Basically this is an Anim server client for
My understanding is that Ladner's theorem is basically this: P != NP implies that
I'm working on a new CMS to use on repeative projects. Basically this chunk
I'm having a problem with the SetLength command. It's basically this problem: I work

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.