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 124767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:03:09+00:00 2026-05-11T05:03:09+00:00

I want to have four colored areas which are clickable. I can user TextBlock

  • 0

I want to have four colored areas which are clickable. I can user TextBlock in a Border to get the color areas, but then neither of them have a Click event. So I can make the whole thing a button, but then it doesn’t have rounded corners and I can’t seem to change the background.

What is the recommended way to go about this, here is what I have so far:

<Window x:Class='WpfApplication6.Window7'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Title='Window7' Height='300' Width='300'>     <UniformGrid>         <UniformGrid.Resources>             <Style TargetType='{x:Type TextBlock}'>                 <Setter Property='FontSize' Value='20'/>                 <Setter Property='HorizontalAlignment' Value='Center'/>                 <Setter Property='VerticalAlignment' Value='Center'/>             </Style>         </UniformGrid.Resources>         <Button BorderThickness='1px' Margin='10' BorderBrush='Blue' CornerRadius='33' Background='Orange'>testing1</Button>         <Border BorderThickness='1px' Margin='10' BorderBrush='Blue' CornerRadius='10' Background='Yellow'>             <TextBlock>testing2</TextBlock>         </Border>         <Border BorderThickness='1px' Margin='10' BorderBrush='Blue' CornerRadius='10' Background='LightBlue'>             <TextBlock>testing3</TextBlock>         </Border>         <Border BorderThickness='1px' Margin='10' BorderBrush='Blue' CornerRadius='10' Background='LightGreen'>             <TextBlock>testing4</TextBlock>         </Border>     </UniformGrid> </Window> 
  • 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. 2026-05-11T05:03:10+00:00Added an answer on May 11, 2026 at 5:03 am

    You have to define a custom template for your button

    For example:

    <UniformGrid>   <UniformGrid.Resources>     <ControlTemplate x:Key='buttonTemp'>       <Border Margin='10' CornerRadius='10' Background='Yellow'>         <TextBlock Text='{TemplateBinding Button.Content}'/>       </Border>     </ControlTemplate>   </UniformGrid.Resources>   <Button Template='{StaticResource buttonTemp}'>testing1</Button> </UniformGrid> 

    See also http://mark-dot-net.blogspot.com/2007/07/creating-custom-wpf-button-template-in.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to have a Hyperlink-Button in a gridView in which I can display a
Say I have four sub-classes of 'Car'. One for each color. I want to
I have four wheels which spin with the numbers 0-9: I want to be
I want to have a layout where i have four colored div's. Say red
I have four email fields in a form, and I want that the user
I have four tables I want to join and get data from. The tables
I have four MemoryStreams of data that I want to merge and then open
Hoping someone can hep with this... I have four logos, I want a three
I have four JTables which for the user looks like one table. (Why four
i want to get box index number using Javascript. like i have four box

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.