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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:18:12+00:00 2026-06-12T14:18:12+00:00

Is it possible to position a control in the XAML definiton relative to another

  • 0

Is it possible to position a control in the XAML definiton relative to another control?
for example if I want to place a control exactly in the middle of another wider control.
and if so – how?

  • 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-12T14:18:13+00:00Added an answer on June 12, 2026 at 2:18 pm

    If you want to center the controls you could wrap them in a grid:

    <Grid>
        <TextBox Height="132"   Width="229" VerticalAlignment="Center" HorizontalAlignment="Center" />
        <Button Content="Button" Height="23" Width="75" VerticalAlignment="Center" HorizontalAlignment="Center" />
    </Grid>
    

    Other positioning can be accomplished by other panels like StackPanel etc. Grid beeing the most flexible choice.

    Edit: updated with grid and columns for controlling position:

    <Grid Height="50" Width="200">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="20*" />
            <ColumnDefinition Width="75*" />
        </Grid.ColumnDefinitions>
        <TextBox Grid.Column="0" Background="Red" />
        <Button Content="Button"  Grid.Column="2"   />
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to position a DIV relative to another DIV? I imagine this
It is possible to use position:absolute and left and right on the middle column
is it possible to balance the position of button(example toolbar in Safari)? UIBarButtonItem *infoButton
Is it possible to position an element within a relative positioned container absolute to
Possible Duplicate: How to change the pop-up position of the jQuery DatePicker control How
Without using percentages, is it possible to position a background image 2px from the
Is it possible to get position inside the OpenLayers container from a lat/long point?
Possible Duplicate: Maintain/Save/Restore scroll position when returning to a ListView how to save scroll
Is it possible to fix the position of a table, such that it scrolls
Is it possible to get the position of an element in the body even

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.