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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:27:24+00:00 2026-05-31T05:27:24+00:00

I am using DockPanel.Dock for docking controls at the specific place(i.e left/right). The problem

  • 0

I am using DockPanel.Dock for docking controls at the specific place(i.e left/right). The problem is my controls are not docking according to the DockPanel.Dock position.

Below is the code for single control with DockPanel.Dock="Right"

    <DockPanel>

         <TextBlock
              Text            ="Left1"
              Margin          ="5"
              DockPanel.Dock  ="Left"
              Style           ="{StaticResource TextBlockStyle}"
              />

         <TextBlock
              Text            ="Left2"
              Margin          ="5"
              DockPanel.Dock  ="Left"
              Style           ="{StaticResource TextBlockStyle}"
              />

         <TextBlock
              Text            ="Right1"
              Margin          ="5"
              DockPanel.Dock  ="Right"
              Style           ="{StaticResource TextBlockStyle}"
              />

   </DockPanel>

enter image description here
code for multiple controls with DockPanel.Dock="Right"

    <DockPanel>

         <TextBlock
              Text            ="Left1"
              Margin          ="5"
              DockPanel.Dock  ="Left"
              Style           ="{StaticResource TextBlockStyle}"
              />

         <TextBlock
              Text            ="Left2"
              Margin          ="5"
              DockPanel.Dock  ="Left"
              Style           ="{StaticResource TextBlockStyle}"
              />

         <TextBlock
              Text            ="Right1"
              Margin          ="5"
              DockPanel.Dock  ="Right"
              Style           ="{StaticResource TextBlockStyle}"
              />

         <TextBlock
              Text            ="Right2"
              Margin          ="5"
              DockPanel.Dock  ="Right"
              Style           ="{StaticResource TextBlockStyle}"
              />

   </DockPanel>

enter image description here

Expecting Output:

enter image description here

Any idea or thought will be appreciated. Thanks in Advance

  • 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-31T05:27:25+00:00Added an answer on May 31, 2026 at 5:27 am

    You should make use of the LastChildFill property:

    <DockPanel LastChildFill="False">
    
        <TextBlock
          Text            ="Left1"
          Margin          ="5"
          DockPanel.Dock  ="Left"
          />
    
        <TextBlock
          Text            ="Left2"
          Margin          ="5"
          DockPanel.Dock  ="Left"
          />
    
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
            <TextBlock
          Text            ="Right1"
          Margin          ="5"
          />
        <TextBlock
          Text            ="Right2"
          Margin          ="5"
          />
    
      </StackPanel>
    
    
    </DockPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the built-in ApplicationCommands to create a menu: <Menu DockPanel.Dock=Top> <MenuItem Header=_Datei> <MenuItem
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I'm using a Datagrid from the WPFtoolkit and am running into a problem with
I have a problem with the DockPanel component. When i resize the panel I
I have quite a tricky problem: I am using a ListView control with the
I'm using the DockPanel Suite in my winforms app. The DockContent class is derived
I have a dockpanel that I dynamically fill using an ItemsControl to populate the
I'm using a Dockpanel as my main panel for my layout. The toolbar on
I am creating dynamically ScatterView items using a template: <s:ScatterView.ItemTemplate > <DataTemplate> <DockPanel LastChildFill=True

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.