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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:31:26+00:00 2026-05-11T06:31:26+00:00

I simply want flowing text on the left, and a help box on the

  • 0

I simply want flowing text on the left, and a help box on the right.

The help box should extend all the way to the bottom.

If you take out the outer StackPanel below it works great.

But for reasons of layout (I’m inserting UserControls dynamically) I need to have the wrapping StackPanel.

How do I get the GroupBox to extend down to the bottom of the StackPanel, as you can see I’ve tried:

  • VerticalAlignment='Stretch'
  • VerticalContentAlignment='Stretch'
  • Height='Auto'

XAML:

<Window x:Class='TestDynamic033.Test3'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Title='Test3' Height='300' Width='600'>     <StackPanel          VerticalAlignment='Stretch'          Height='Auto'>          <DockPanel              HorizontalAlignment='Stretch'              VerticalAlignment='Stretch'              Height='Auto'              Margin='10'>              <GroupBox                  DockPanel.Dock='Right'                  Header='Help'                  Width='100'                  Background='Beige'                  VerticalAlignment='Stretch'                  VerticalContentAlignment='Stretch'                  Height='Auto'>                 <TextBlock Text='This is the help that is available on the news screen.' TextWrapping='Wrap' />             </GroupBox>              <StackPanel DockPanel.Dock='Left' Margin='10' Width='Auto' HorizontalAlignment='Stretch'>                 <TextBlock Text='Here is the news that should wrap around.' TextWrapping='Wrap'/>             </StackPanel>          </DockPanel>     </StackPanel> </Window> 

Answer:

Thanks Mark, using DockPanel instead of StackPanel cleared it up. In general, I find myself using DockPanel more and more now for WPF layouting, here’s the fixed XAML:

<Window x:Class='TestDynamic033.Test3'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Title='Test3' Height='300' Width='600' MinWidth='500' MinHeight='200'>     <DockPanel          VerticalAlignment='Stretch'          Height='Auto'>          <DockPanel              HorizontalAlignment='Stretch'              VerticalAlignment='Stretch'              Height='Auto'              MinWidth='400'             Margin='10'>              <GroupBox                  DockPanel.Dock='Right'                  Header='Help'                  Width='100'                  VerticalAlignment='Stretch'                  VerticalContentAlignment='Stretch'                  Height='Auto'>                 <Border CornerRadius='3' Background='Beige'>                     <TextBlock Text='This is the help that is available on the news screen.' TextWrapping='Wrap'                   Padding='5'/>                 </Border>             </GroupBox>              <StackPanel DockPanel.Dock='Left' Margin='10' Width='Auto' HorizontalAlignment='Stretch'>                 <TextBlock Text='Here is the news that should wrap around.' TextWrapping='Wrap'/>             </StackPanel>          </DockPanel>     </DockPanel> </Window> 
  • 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. 2026-05-11T06:31:26+00:00Added an answer on May 11, 2026 at 6:31 am

    It sounds like you want a StackPanel where the final element uses up all the remaining space. But why not use a DockPanel? Decorate the other elements in the DockPanel with DockPanel.Dock='Top', and then your help control can fill the remaining space.

    XAML:

    <DockPanel Width='200' Height='200' Background='PowderBlue'>     <TextBlock DockPanel.Dock='Top'>Something</TextBlock>     <TextBlock DockPanel.Dock='Top'>Something else</TextBlock>     <DockPanel         HorizontalAlignment='Stretch'          VerticalAlignment='Stretch'          Height='Auto'          Margin='10'>        <GroupBox          DockPanel.Dock='Right'          Header='Help'          Width='100'          Background='Beige'          VerticalAlignment='Stretch'          VerticalContentAlignment='Stretch'          Height='Auto'>         <TextBlock Text='This is the help that is available on the news screen.'                     TextWrapping='Wrap' />      </GroupBox>        <StackPanel DockPanel.Dock='Left' Margin='10'             Width='Auto' HorizontalAlignment='Stretch'>           <TextBlock Text='Here is the news that should wrap around.'                       TextWrapping='Wrap'/>       </StackPanel>     </DockPanel> </DockPanel> 

    If you are on a platform without DockPanel available (e.g. WindowsStore), you can create the same effect with a grid. Here’s the above example accomplished using grids instead:

    <Grid Width='200' Height='200' Background='PowderBlue'>     <Grid.RowDefinitions>         <RowDefinition Height='Auto'/>         <RowDefinition Height='*'/>     </Grid.RowDefinitions>     <StackPanel Grid.Row='0'>         <TextBlock>Something</TextBlock>         <TextBlock>Something else</TextBlock>     </StackPanel>     <Grid Height='Auto' Grid.Row='1' Margin='10'>         <Grid.ColumnDefinitions>             <ColumnDefinition Width='*'/>             <ColumnDefinition Width='100'/>         </Grid.ColumnDefinitions>         <GroupBox             Width='100'             Height='Auto'             Grid.Column='1'             Background='Beige'             Header='Help'>             <TextBlock Text='This is the help that is available on the news screen.'                TextWrapping='Wrap'/>         </GroupBox>         <StackPanel Width='Auto' Margin='10' DockPanel.Dock='Left'>             <TextBlock Text='Here is the news that should wrap around.'                TextWrapping='Wrap'/>         </StackPanel>     </Grid> </Grid> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I simply want to hide a div, if a text box loses focus, unless,
I simply want to have an indeterminate JProgressBar animate in the bottom left corner
I simply want to return all rows from a users table but selected fields,
I simply want to copy all the files and folders from a network location
I simply want to list all of the directories under my current working directory,
I simply want to pass from top to bottom as a hover, but the
I simply want to spit out the 5 most recent rows created (IDs) so
I simply want to know if there is a way to mock an array
I simply want my method call to suppress all NoMethodError exceptions that might arise
I simply want to display the UIMenuController right after a textfield has become active.

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.