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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:38:04+00:00 2026-06-04T11:38:04+00:00

I need a panel with 3 items arranged horizontally, one aligned left, one right

  • 0

I need a panel with 3 items arranged horizontally, one aligned left, one right and the last centered in the remaining space. I can get this with:

<DockPanel LastChildFill="True">
    <TextBlock DockPanel.Dock="Left" Text="TextLeft" FontSize="40" Foreground="DarkOrange"/>
    <TextBlock DockPanel.Dock="Right" Text="TextRight" FontSize="40" Foreground="DarkOrange"/>
    <TextBlock Text="TextMiddle" FontSize="40" HorizontalAlignment="Center"/>
</DockPanel>

enter image description here

But I’d like that when the width is smaller than the sum of item widths that it is “TextRight” that gets eaten into NOT “TextMiddle” as is shown below:

enter image description here

Note Ive tried adding MinWidth on TextMiddle – but this doesn’t change the behavior – because TextMiddle is last child of a LastChildFill=”True” DockPanel.

The XAML below gets me the correct behavor on resize (TextRight gets eaten into when space in limited) but “TextMiddle” is not centered in the available space when there is enough width:

<DockPanel LastChildFill="False" >
    <TextBlock DockPanel.Dock="Left" Text="TextLeft" FontSize="40" Foreground="DarkOrange"/>
    <TextBlock DockPanel.Dock="Left" Text="TextMiddle" FontSize="40" HorizontalAlignment="Center" />
    <TextBlock DockPanel.Dock="Right" Text="TextRight" FontSize="40" Foreground="DarkOrange"/>
</DockPanel>

enter image description here
enter image description here

I’m sure there is an easy solution to this – maybe by using a subpannel in one of the items – but I just cant get my head around exactly how. Any help much appreciated.

  • 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-04T11:38:05+00:00Added an answer on June 4, 2026 at 11:38 am

    Maybe this is it?

    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="2*" MinWidth="350"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <UniformGrid HorizontalAlignment="Stretch" Rows="1">  
           <TextBlock Name="TextLeft" Text="TextLeft" FontSize="40" Foreground="DarkOrange"/>  
           <TextBlock Name="TextMiddle" Text="TextMiddle" FontSize="40" HorizontalAlignment="Center" />  
      </UniformGrid>
      <TextBlock Grid.Column="1" HorizontalAlignment="Right" Text="TextRight" FontSize="40" Foreground="DarkOrange"/>  
    </Grid>   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get two JPanels into one JApplet. paneel = new RekenmachinePaneel(); nummer
Please help me. how can I get user input. Mytest.views.Forma = Ext.extend(Ext.Panel, {/*This is
I make Panel(layout:Absolute). After, I add Items to Panel. But I can't see that
I have ScrollViewer and child Stack panel. I need my HorizontalScrollBar automatically scroll right
I need a search panel similar to the findpanel in devexpress. FindPanel is a
I need to layout a panel on the top of my Dialog so that
I need to create a panel to display a long radiobutton form with a
I have a foreach loop in jQuery going through each 'div.panel', I need to
I need to handle multiple panels, containing variuous data masks. Each panel shall be
I've successfully created my application's Settings.bundle and the items I need within it. 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.