Dear all,
I have an application with many forms as mdichildren on an mdi parent form
And i want to make a new form which do the following:
1. take a name of a form
2. pressing a button and exports all the objects (names) of the form given in a file.
I used the following code on the button click:
System.Windows.Forms.Form[] frms=frmMain.MdiChilldren;
for(i=0;i<frms.Length;i++)
{
if (frms.Name="given name")
{
System.Windows.Forms.Control.ControlCollection ctl=new System.Window.Forms.Control.ControlCollection(frms
for(j=0;j<ctl.Count;j++)
{
// Write to the file
}
}
}
Now The problem is the following:
1. In Order to fill the frms collection it is nessecary the form that i must export the objects be loaded
2. Even if the form is loaded the ControlCollection ctl doesn't filled.
So How can i fill the formcollection without be loaded and how will i fill the ctl controlcollection?
The above code is working perfect when i fill the ctl as
System.Windows.Forms.Control.ControlCollection ctl=new System.Window.Forms.Control.ControlCollection(this)
Many Thanks
I have an application with many forms as mdichildren on an mdi parent form
And i want to make a new form which do the following:
1. take a name of a form
2. pressing a button and exports all the objects (names) of the form given in a file.
I used the following code on the button click:
System.Windows.Forms.Form[] frms=frmMain.MdiChilldren;
for(i=0;i<frms.Length;i++)
{
if (frms.Name="given name")
{
System.Windows.Forms.Control.ControlCollection ctl=new System.Window.Forms.Control.ControlCollection(frms
for(j=0;j<ctl.Count;j++)
{
// Write to the file
}
}
}
Now The problem is the following:
1. In Order to fill the frms collection it is nessecary the form that i must export the objects be loaded
2. Even if the form is loaded the ControlCollection ctl doesn't filled.
So How can i fill the formcollection without be loaded and how will i fill the ctl controlcollection?
The above code is working perfect when i fill the ctl as
System.Windows.Forms.Control.ControlCollection ctl=new System.Window.Forms.Control.ControlCollection(this)
Many Thanks