Results 1 to 3 of 3

Thread: Help needed to dynamically add a button to a cell in a TableLayoutPanel:

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    41

    Smile Help needed to dynamically add a button to a cell in a TableLayoutPanel:

    Hello everybody,

    I am trying to dynamically add a button to a TableLayoutPanel at a particular column and row location, but I don't seem to be having much luck so far.
    The following code compiles, but I don't see anything on my form (Form1). Any help would be much appreciated in solving the problem.

    What I would like to eventually have working is a routine that would use two arrays of integer values for the cell positions - (in conjunction with an array of Button objects) to determine where in the TableLayoutPanel my Button objects would be added.

    Code:
      
                 
                //This is just a test to get the basics working first!!!
                public Form1()
                {
                
                     InitializeComponent();
    
                     Button MyButton = new Button();
                     MyButton.Visible = true;
    
                     TableLayoutPanel MyPanel = new TableLayoutPanel();  
                     TableLayoutPanelCellPosition MyCellPosition = new      TableLayoutPanelCellPosition();
               
                     MyCellPosition.Column = 1;
                     MyCellPosition.Row = 1;
    
                     MyPanel.SetCellPosition(MyButton, MyCellPosition);
    
                }
    Last edited by The Thing; Dec 6th, 2006 at 06:52 PM.
    Using: VB.net + C#.net 2005 Express Editions + .Net Framework 2.0

    ~ Man Is The Warmest Place To Hide ~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width