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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:06:46+00:00 2026-06-02T21:06:46+00:00

In trying to get some labels in a TableLayoutPanel to move from the top

  • 0

In trying to get some labels in a TableLayoutPanel to move from the top left of their cells to the center of the cells, I’m trying to experiment with adding padding and/or margins.

However, nothing I’ve tried works. Here’s the code I’ve tried and the results:

// Setting the padding just cuts off the bottom part of the text
//lbl.Padding = new System.Windows.Forms.Padding(1);

// How to set Margin?
//lbl.Margin = new System.Windows.Forms.Margin(1); <- This mimics "Padding" but is not recognized
//lbl.Margin = new Thickness(6); <- This is the only example I could find, but it's for WPF
  • 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-02T21:06:50+00:00Added an answer on June 2, 2026 at 9:06 pm

    Try:

    lbl.Margin = new Padding(1);
    

    You might also want to do:

    lbl.Dock = DockStyle.Fill;
    lbl.TextAlign = ContentAlignment.MiddleCenter;
    lbl.AutoSize = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get some form data from POST method. Here's the code
I am trying to style some form labels by selecting them with their 'for'
I'm trying to get some information filtered from this kind of page (http://www.ricardo.ch/kaufen/computer-und-netzwerk/apple/ipad/apple-ipad-16gb-3gwifi-neu-case-komplettes-zubehoer/v/an637769334/). I'd
I'm trying to get wxCheckBox to have sensitive label like it is in some
Im trying to get some checkbox with a specific name document.getElementsByName(test); Unfortunatley i cant
Just trying to get some rows out of a database and loop through but
Im trying to get some system information using WMI but the problem is when
I am trying to get some errors returned in JSON format. So, I made
I am trying to get some content in html documents. Some of the documents
i am trying to get some data, but i dont know how can i

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.