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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:58:34+00:00 2026-05-17T18:58:34+00:00

Right now I clarify this may be a duplicated question from: Right-aligned labels in

  • 0

Right now I clarify this may be a duplicated question from: Right-aligned labels in WinForms
But non of the answers satisfied me.

The problem is very simple:

I have a right aligned label with autosize set to true. The expected behavior is that when the text is increased the right coordinate remain unchanged. But that is not what it happens. The left coordinate is the one which remains unchanged.

My app is kind of small, so I don’t want to start putting controls into panels and so. So I’ve tried all solutions that involved ONLY label properties. The only one which worked is to set autosize to false and over-size it. (Accepted solution of question Nº1692383). But it is really ugly! I’d really like to avoid that.

Any other possible solution?

  • 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-17T18:58:34+00:00Added an answer on May 17, 2026 at 6:58 pm

    One solution would be to capture the label’s right margin in the form constructor, and in the label SizeChanged event, reset the location based on the initial right margin, the label’s current Width and the label Parent’s current Width.

    This also assumes the label is anchored on the right to handle form resizing.

    private readonly int _rightMargin;
    
    public Form1()
    {
        InitializeComponent();
    
        _rightMargin = label1.Parent.Width - label1.Right;
    }
    
    private void label1_SizeChanged(object sender, EventArgs e)
    {
        label1.Location = new Point(label1.Parent.Width - _rightMargin - label1.Width, label1.Top);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this might sound like a stupid question, but i want to clarify a concept:
Realize this may sound like a broad question - so let me clarify. I
Right now when I run this it keeps clicking on the same button every
Right now, I've just some code which fetches the picture from the URL directly.
This may be more of a scoping question. I'm trying to set a JSON
Right now we just use something like this stopWatch.Start(); try { method(); } finally
Let me clarify my question. I'm trying to get an integer value from @student.rooms.last,
I'm trying implement pull to refresh on a ListFragment but right now none of
To clarify: Right now, most likely due to readability, CSS is written somewhat like
Right now I have an upload field while uploads files to the server. The

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.