Move button by TextBlock length

Posted on 2011-10-25
Last Modified: 2012-06-21
Hello all,

I program with WPF. How can I move my button according to the length of TextBlock? The button should always at the end of the Textblock. (Attached file, button doesn't move together with the TextBlock)  


                     <DataGridTextColumn ....  />
                     <DataGridTextColumn ....  />
                            <StackPanel Orientation="Horizontal">
                                <TextBlock HorizontalAlignment="Left"/>
                                <Button HorizontalAlignment="Right" VerticalAlignment="Bottom"/>

Thank you very much in advance. :)
Question by:chang2008
    1 Comment
    LVL 10

    Accepted Solution


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now