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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:22:35+00:00 2026-06-09T04:22:35+00:00

In my WPF application, I have a horizontal StackPanel that I am trying to

  • 0

In my WPF application, I have a horizontal StackPanel that I am trying to use as a toolbar. Within this panel, I have buttons, comboboxes and textboxes. As the buttons are the tallest, the StackPanel takes their height. And the same do the comboboxes and textboxes. But I want them to stay as they are, otherwise they look ugly. How can I prevent them to expand and fill all available space? I tried to set their height to Auto or to an explicit size, but that didn’t help. I also tried to replace the StackPanel with a Grid, but this didn’t help either. What am I doing wrong?

      <StackPanel Orientation="Horizontal" Margin="3, 10">
        <ComboBox x:Name="Agencies" DisplayMemberPath="Name" SelectedValuePath="Value" 
                  SelectedItem="{Binding SelectedAgency}"
                  Height="50"  MinWidth="100" Margin="3,0"/>
        <Button x:Name="UploadFile"
            MinWidth="70"
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center" 
            attachProperties:ButtonIcon.Icon="Resources/Images/add.png"
            Content="Upload File"  IsEnabled="{Binding EnrollmentFiles.Any}"                           
            Style="{StaticResource ImageButtonStyle}" />          
         <Button x:Name="EnrollmentDelete"
            MinWidth="70"
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center" 
            attachProperties:ButtonIcon.Icon="Resources/Images/Remove.png"
            Content="Delete Enrollment"  IsEnabled="{Binding EnrollmentFiles.Any}"                           
            Style="{StaticResource ImageButtonStyle}" />

        <TextBox x:Name="WorkSheetName" />
    </StackPanel>
  • 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-09T04:22:36+00:00Added an answer on June 9, 2026 at 4:22 am

    You need to set the VerticalAlignment on your ComboBox and TextBox to something like Center. By default it’s set to Stretch

    <TextBox VerticalAlignment="Center" ... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application where I have defined custom commands that use the
I have a WPF application that I'm trying to dynamically add items to a
In my WPF Application I have an GridViewColumn that looks like this: <GridViewColumn Width=170>
Basically I have a WPF application that will display announcements to the user within
In my WPF application I have some drawing functionality. I have solved this using
In my WPF application I have a View that is given a ViewModel, and
I want my WPF application to have a ToggleButton that contains an image of
In a WPF/MVVM application I have a custom control on a particular view. This
I am trying to use Command and CommandParameter binding with Buttons in a WPF
I have a ToolBar WPF control which has a Stackpanel docked to right. I

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.