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

  • Home
  • SEARCH
  • 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 9011375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:42:42+00:00 2026-06-16T02:42:42+00:00

Using a TableLayoutPanel in Windows Forms. I am using RowStyles and ColumnStyles with SizeType

  • 0

Using a TableLayoutPanel in Windows Forms. I am using RowStyles and ColumnStyles with SizeType as AutoSize and Percent respectively. I need to find out the absolute height and width of a cell in which a particular control is placed.

TableLayoutPanelCellPosition pos = tableLayoutPanel1.GetCellPosition(button1);
int height = (int)tableLayoutPanel1.RowStyles[pos.Row].Height;
int width = (int)tableLayoutPanel1.ColumnStyles[pos.Column].Width;

Above, I am getting height as 0. RowStyle is with SizeType as AutoSize.
Similarly, I am getting as 33.33. ColumnStyle is set with SizeType as Percent and Size = 33.33.

I need to get absolute size in pixels for the cell.

  • 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-16T02:42:43+00:00Added an answer on June 16, 2026 at 2:42 am

    For some odd reason, Microsoft decided to hide those functions from intellisense.

    This should work as written:

      TableLayoutPanelCellPosition pos = tableLayoutPanel1.GetCellPosition(button1);
      int width = tableLayoutPanel1.GetColumnWidths()[pos.Column];
      int height = tableLayoutPanel1.GetRowHeights()[pos.Row];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using the System.Windows.Forms.TableLayoutPanel control on a windows form, it sets the background color
Using C++/CLI and Windows Forms, I'm trying to make a simple scrollable list of
I am creating an application using Windows Application Forms . I'm basically new to
I am currently developing an application in C# using Windows Forms. I am using
I created a user control for Windows forms application. All it has is a
am using TableLayoutPanel to show the images.. here dynamically i ll add lot image
using grep, vim's grep, or another unix shell command, I'd like to find the
I am using a tableLayoutPanel which consist of two rows. In first row I
Using this example . Pretend there are date fields in both forms. How would
I started with using a TableLayoutPanel, but when I have big tables, they are

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.