List Info

Thread: C-Sharp (C#) Group: Re: Any ideas on how I can loop over a list and add a groupbox to a windows form




C-Sharp (C#) Group: Re: Any ideas on how I can loop over a list and add a groupbox to a windows form
user name
2006-02-17 14:05:49
Hi,
If I am taking you properly, then adding groupboxes to your
winform is
pretty easy.
I have crated a form where I take input for how many
groupboxes to be
crated.In that form I have a panel where I attach all the
groupboxes.It
works properly.

int noOfGrpBxes =
Convert.ToInt32(this.txtNumber.Text.Trim());
			GroupBox tempGroupBox = null;
			for(int i = 0; i < noOfGrpBxes; i++)
			{
				tempGroupBox = new GroupBox();
				tempGroupBox.Text = "GroupBox : " +
i.ToString();
				tempGroupBox.Dock = DockStyle.Left;
                                                            
   // this
is the panel where I am attaching

//groupboxes
				this.pnlGroupBoxes.Controls.Add(tempGroupBox);
			}

Hope this code snippet will help.
If you need further help lemme know.

Arindam Sinha


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )