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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:01:41+00:00 2026-06-15T05:01:41+00:00

I have the below XAML which shows some padding under the buttons in the

  • 0

I have the below XAML which shows some padding under the buttons in the UniformGrid:

<Grid>
  <UniformGrid Background="#CCC"
               HorizontalAlignment="Stretch"
               VerticalAlignment="Bottom"
               Margin="8,8,8,0">
    <Button Height="28"
            Margin="5">
      OK
    </Button>
    <Button Height="28"
            Margin="5">
      Cancel
    </Button>
  </UniformGrid>
</Grid>

It displays as:

2 Buttons

But if I remove one of the buttons, no padding will occur:

1 Button

How can I remove this padding when 2 buttons are in the XAML?

I have tried the obvious Padding and Margin properties but it remains the same.

  • 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-15T05:01:43+00:00Added an answer on June 15, 2026 at 5:01 am

    Try specifying the number of rows:

    <UniformGrid Rows="1" />
    

    UniformGrid will automatically set the number of columns and rows according to the number of elements added to it. Take a look at this post.

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

Sidebar

Related Questions

I have some xaml code for a silverlight project sort of like below: <Grid>
We have some XAML which may seem odd but apparently is needed for defining
I have the following xaml which resides in a wpf user control - <Grid>
I have the below XAML which attempts to set the border of all TextBoxes
I have a list on my WPF xaml which contains two items. Below is
I currently have a Checkbox under my settings.xaml page, which the users is to
I have below XAML code : <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml DataContext={Binding RelativeSource={RelativeSource Self}} WindowStartupLocation=CenterScreen
I have below snippet of code in which TestClass is extending jPanel which is
I Have a ResourceDictionary Generic.xaml which consists of a set of other resource dictionaries,
I have used BackButtonStyle which is created in StandardStyles.xaml (while creating new metro project).

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.