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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:05:57+00:00 2026-05-23T12:05:57+00:00

I have a label and a textbox in my Winform. They are one line.

  • 0

I have a label and a textbox in my Winform. They are one line.

in

What I want to do is to make the textbox always fill-in the available space between the label and the right border of the container, even when window is resized

The label is set to be AutoSize because it has different width in different languages.

I tried the flow layout, and I also tried various combinations of dock/anchor in both elements, but still can’t make it work. If there is not simple solution (beside program coding resizing myself), is there a less optimal solution? Thanks.

  • 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-23T12:05:58+00:00Added an answer on May 23, 2026 at 12:05 pm

    if it’s only those 2 elements that need to be auto-layouted try this:

    take a table layout panel with 2 columns and one row … your label goes in one cell, the textbox in the other … dock both elements (dock fill) and set the column the label is in to autosize

    dock the whole panel to whatever element you want (probably your form)

    you may want to add some padding to your label

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my problem, I have one textbox, one button and one label. Everything
i have a label tag and i want to remove text between <label> </label>
I have a custom made dialog winform. On it I have a label, textbox
suppose i have label and button on textbox and i want that if i
in an asp.net application, I have a Label and a textbox. I want the
I have a bunch of custom UITableViewCells with a label and textbox. I have
hello everybody i have a listbox within which is a datatemplate.Inside it is checkbox,textbox,label...Wat
I have few controls (Label, Custom Textbox, Datagridview) docked on a form. When I
I have TextBox (multiline) and Label in an UpdatePanel which I refresh with javascript
I have a label which labels the line numbers based on the text on

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.