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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:35:35+00:00 2026-05-25T06:35:35+00:00

I’ve been using Windows Forms for years, but I’m relatively new to WPF. I

  • 0

I’ve been using Windows Forms for years, but I’m relatively new to WPF. I have a number of radio buttons without labels (the labels are at the top of the column, don’t worry about them! This program is going to run on a tablet so I want to make the hit area for the radio buttons as large as possible. I also need the radio buttons to be in the center of their column and row.

I can get the look I want by adding this to each column of my grid:

<Label Name="connectedLabel" Grid.Column="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
    <RadioButton x:FieldModifier="private" Name="connectedRadioButton" Grid.Column="2" Checked="otherRadioButton_CheckedChanged" Unchecked="otherRadioButton_CheckedChanged"></RadioButton>
</Label>

Which just centers a radio button within a label that fills the grid section.
Obviously the behaviour is all wrong though (events don’t pass through, you can select multiple radiobuttons on the same row, etc.).

This would be cake in Winforms, I’m hoping there’s a simple solution in WPF.

Can anybody help?

Edit: The orange area is the default hit area for the radio button, the green area is the hit area I want. So far this is looking impossible without a lot of custom wiring

enter image description here

  • 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-05-25T06:35:36+00:00Added an answer on May 25, 2026 at 6:35 am

    Edit per new image in question.

    If you don’t mind the extra typing you can use this:

            <Style TargetType="RadioButton" x:Key="rb">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="RadioButton">
                            <Grid>
                                <RadioButton IsChecked="{Binding Path=IsChecked, RelativeSource={RelativeSource Mode=TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <Border Background="Transparent" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
    

    This works as expected in my little test app of:

    <Grid>
        <Grid.Resources>
            <Style TargetType="RadioButton" x:Key="rb">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="RadioButton">
                            <Grid>
                                <RadioButton IsChecked="{Binding Path=IsChecked, RelativeSource={RelativeSource Mode=TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <Border Background="Transparent" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
    
            <Style TargetType="ListBoxItem" x:Key="ics">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Grid ShowGridLines="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
    
                                <RadioButton HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <RadioButton HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1" />
                                <RadioButton Style="{StaticResource rb}" Grid.Column="2" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
    
        <ListBox ItemContainerStyle="{StaticResource ics}">
            <ListBoxItem>1</ListBoxItem>
        </ListBox>
    </Grid>
    

    Which looks like:

    enter image description here

    (Obviously you will want to use the third method provided)

    I know this doesn’t look like much, but it gives you your result. Again, excuse the extra typing and the lack of coding standards used.

    For this, the mouse hover-over won’t give the visual effect, but the hit-test is valid. I assume this will be OK so long as this will be on a tablet and you don’t track fingers.


    If you just want the control to be of larger size you could use the following methods

    You can resize a control by setting the RenderTransform property to a ScaleTransform object.

    Resize all RadioButton objects within a container (Window, Page, Grid etc)

    <Window.Resources>
        <Style TargetType="RadioButton">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="10" ScaleY="10"/>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    

    Or all with key

        <Style TargetType="RadioButton" x:Key="resizeRadioButton">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="10" ScaleY="10"/>
                </Setter.Value>
            </Setter>
        </Style>
    

    Usage:

    <RadioButton Style="{StaticResource resizeRadioButton}" />
    

    Or individually

    <RadioButton>
        <RadioButton.RenderTransform>
            <ScaleTransform ScaleX="10" ScaleY="10"/>
        </RadioButton.RenderTransform>
    </RadioButton>
    

    If however you want to use a combination of larger control and larger hit area (or just larger hit area for all controls of a set type), you can use:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
        <Style TargetType="RadioButton">
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
    
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
                </Setter.Value>
            </Setter>
    
           <Setter Property="Content">
               <Setter.Value>
                   <Border>
                       <Rectangle Margin="-10" Fill="Transparent" />
                   </Border
               </Setter.Value>
           </Setter>
        </Style>
    
    </ResourceDictionary>
    

    Or just use the default behaviour of the control inside another container, and use the HorizontalAlignment="Stretch" property, this will however draw the control in the upper-left corner I believe.

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am writing an app with both english and french support. The app requests
I'm parsing an XML file, the creators of it stuck in a bunch social

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.