Copy of the control

  • Thread starter Thread starter news
  • Start date Start date
N

news

Im using a Panel control and its instance as template and I want to create
more instances of this Panel based on the template... how to do Copy of the
control as new instance???

Thanks...

Me
 
// define a template
class mypaneltemplate: Panel
{
public mypaneltemplate()
{
this.BorderStyle = BorderStyle.FixedSingle;
this.Size = new Size(50,50);
}
}


// Create the panel objects when the user clicks a button
private void button1_Click(object sender, System.EventArgs e)
{

for (int i=1; i<10; i++)
{
mypaneltemplate mypanel = new mypaneltemplate();
mypanel.Parent = this;
mypanel.Location = new Point (i*30,i*30);
this.Controls.Add(mypanel);
}
}


--------------------
| From: "(e-mail address removed)" <[email protected]>
| Subject: Copy of the control
| Date: Wed, 6 Aug 2003 14:45:10 +0200
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: gw.coty.cz 62.77.75.65
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:30270
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Im using a Panel control and its instance as template and I want to create
| more instances of this Panel based on the template... how to do Copy of
the
| control as new instance???
|
| Thanks...
|
| Me
|
|
|
 
Back
Top