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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:23:31+00:00 2026-05-18T21:23:31+00:00

On a window control, my main container is a grid. My grid has 2

  • 0

On a window control, my main container is a grid.
My grid has 2 rows, one row definition is 50*, and the other is 250*.
Now i want to add a right sidebar, lets say with a StackPanel.
I would like to have a ListBox inside the StackPanel that aligns with the 50* grid row, so as the window height gets bigger, the ListBox size will also get bigger.
My question is whether i can achieve this behavior while the ListBox is inside the StackPanel (which is nested inside the grid) or must the ListBox be placed directly inside the grid?

  • 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-18T21:23:32+00:00Added an answer on May 18, 2026 at 9:23 pm

    StackPanel does not stretch vertically.

    If you must need a wrapping parent container, use a Grid, which will expand in all directions (if you leave the Horizontal- and VerticalAlignment alone of course 😉 )

    Also check out the Panel Overview on MSDN.

    Panel Name       x-Dimension             y-Dimension
    
    
    - Canvas         Constrained to content     Constrained to content
    - DockPanel      Constrained             Constrained
    - StackPanel     Constrained             Constrained to content
      (Vertical Orientation)    
    - StackPanel     Constrained to content  Constrained 
      (Horizontal Orientation)  
    - Grid        Constrained             Constrained, except in cases where Auto apply to rows and columns
    - WrapPanel      Constrained to content  Constrained to content
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My WPF application consists of a main window with a tab control which has
I have a window with 2 column grid. Left column contains a browser control
I want my main WPF window during the runtime, when there is not enough
I'm subclassing a native window (the edit control of a combobox...) oldWndProc = SetWindowLong(HandleOfCbEditControl,
I have a Window with my user control and I would like to make
How do I create a button control (with CreateWindow of a BUTTON window class)
Is there any way to dock a Silverlight control to the browser window? For
I have a TreeView windows forms control with an ImageList , and I want
I have a window form application, and it has multiple threads running that would
I am creating a Windows Forms control derived from UserControl to be embedded in

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.