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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:11:18+00:00 2026-06-16T13:11:18+00:00

I have the following: <DockPanel Height=25 HorizontalAlignment=Stretch> <Button Content=Add x:Name=bAdd DockPanel.Dock=Left /> <Button Content=Remove

  • 0

I have the following:

<DockPanel Height="25" HorizontalAlignment="Stretch">
    <Button Content="Add" x:Name="bAdd" DockPanel.Dock="Left" />
    <Button Content="Remove" x:Name="bRemove" DockPanel.Dock="Right" />
</DockPanel>

Can someone suggest me how to make both the buttons have equal width without setting the Width property of the buttons manually?

  • 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-16T13:11:20+00:00Added an answer on June 16, 2026 at 1:11 pm

    If you absolutely don’t want to set the Width propety, you can just use a Grid :

    <Grid Height="25" HorizontalAlignment="Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Button Grid.Column="0" Content="Add" x:Name="bAdd" />
        <Button Grid.Column="1" Content="Remove" x:Name="bRemove" />
    </Grid>
    

    They will both have the same Width this way

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

Sidebar

Related Questions

I have the following visual tree: <DockPanel> <TextBox Name=ElementWithFocus DockPanel.Dock=Left /> <ListBox DockPanel.Dock=Left Width=200
I have the following XAML: <DockPanel x:Name=OverViewContainer AllowDrop=True> <StackPanel Orientation=Horizontal DockPanel.Dock=Bottom HorizontalAlignment=Right> <uicommon:Toolbar DataContext={Binding
I have the following Grid . <Grid DockPanel.Dock=Bottom> <Border HorizontalAlignment=Stretch VerticalAlignment=Stretch CornerRadius=4 Background={DynamicResource {x:Static
I have the following code: <DockPanel> <StackPanel DockPanel.Dock=Top Orientation=Horizontal> <RadioButton Content=_Programs IsChecked={Binding Path=ProgramBanksSelected} IsEnabled={Binding
I have defined following in a ResourceDictionary: <DockPanel x:Key=errorDisplay LastChildFill=False> <Border Background=Red DockPanel.Dock=Top> <TextBlock
I have the following custom Validation.ErrorTemplate: <Setter Property=Validation.ErrorTemplate> <Setter.Value> <ControlTemplate> <DockPanel LastChildFill=True> <Label DockPanel.Dock=Bottom
I have the following ItemsControl : <ItemsControl x:Name=ListResult> <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> <Image Margin=10,0,0,0 Source={Binding
I have the following xaml: <DockPanel> <DockPanel.Resources> <Style TargetType=Button> <Style.Triggers> <Trigger Property=IsMouseOver Value=True> <Setter
I have created a listbox control with following DataTemplate <DataTemplate x:Key=lb_Itemtemplate> <DockPanel> <TextBlock Text={Binding}
I have the following (simplifed) section in my XAML file: <Menu Width=Auto Height=20 Background=#FFA9D1F4

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.