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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:24:52+00:00 2026-06-09T16:24:52+00:00

When I drop a control, such as a Label or a TextBox, on a

  • 0

When I drop a control, such as a Label or a TextBox, on a TableLayoutPanel, it has (among many others, of course) the following properties:

Cell.Column
Cell.Row
Column
Row

…but these controls don’t normally have these properties (IOW, Labels and TextBoxes that are not dropped on the TLP do not have them).

How can I programmatically assign values to these properties (to controls I want to embed within a TLP)?

This is my existing code for the Labels:

. . .
lblName = string.Format("label{0}", i);
var lbl = new Label()
{
    Name = lblName,
    Parent = tableLayoutPanelPlatypi,
    Column = ColNum, // Doesn't compile; Column property not recognized
    Row = i - 1,     // Doesn't compile; Row property not recognized
    Dock = DockStyle.Fill,
    Margin = 0,
    TextAlign = ContentAlignment.MiddleCenter,
    Text = GettysburgAddressObfuscation()
};
  • 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-09T16:24:53+00:00Added an answer on June 9, 2026 at 4:24 pm

    You can add them via the TableLayoutPanel’s controls Add method:

    tableLayoutPanelPlatypi.Controls.Add(lbl, ColNum, i - 1);
    

    or as you pointed out, each property can be set individually:

    tableLayoutPanelPlatypi.SetColumn(lbl, ColNum);
    tableLayoutPanelPlatypi.SetRow(lbl, i - 1);
    

    The Form’s Designer is adding those properties conveniently for you, but if you look inside the designer file at a control that has been added to the TableLayoutPanel, it uses that format above.

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

Sidebar

Related Questions

I have a composite drop down calendar user control that consists of a textbox
Is there a way that one can make a control, such as a textbox,
I would like to implement a drag&drop operation from TextBox to another control. The
I want to drag and drop a control (label for example) in a winform
With ASP.NET Webforms, I could drag and drop a control on a form and
In Windows Forms, is it possible to configure a drop-down combobox control so that
I want to add Drop Down List html control to the web page fill
I have a drop-down list hardcoded in an MVC View User Control page and
I have a user control in a master page with two drop down lists.
i have a treview control with drag&drop functionality that response to draw the node

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.