|
-
Aug 30th, 2006, 01:09 PM
#1
Thread Starter
Member
Programmatically adding buttons to a tableLayoutPanel
Hello everybody,
By adapting the code I've found here I am able to programmatically add buttons to my form as needed, but what I would like to be able to do is add my buttons to particular cells in a tableLayoutPanel.
I assume that a tableLayoutPanel has some form of row / column coordinate system for addressing each cell but I'm not having any luck in figuring it out.
Does anyone have any ideas how I might go about this. Thank you for your help.
Regards,
The Thing.
Using: VB.net + C#.net 2005 Express Editions + .Net Framework 2.0
~ Man Is The Warmest Place To Hide ~
-
Aug 30th, 2006, 02:09 PM
#2
Thread Starter
Member
Re: Programmatically adding buttons to a tableLayoutPanel
I'm a newbie when it comes to Visual C# so it's taking me a while to get used to things, but I've managed to figure it out.
Code:
int cellX = 1; //.....or whatever value you need.
int cellY = 1; //.....or whatever value you need.
Button myButton = new Button();
tableLayoutPanel myTableLayoutPanel = new tableLayoutPanel();
myTableLayoutPanel.Controls.Add(myButton, cellX, cellY);
I'll investigate how to paint individual cells of a tableLayoutPanel and post the code when I have it done.
Thanks for checking out my thread anyway
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|