controls on child

M

Maarten

hi all

Im trying to set a timer to the enabled state on an mdi childform.
if i load only one form there is no problem.
but when i load more than one form the timer can't be enabled.
I want to be able to enable the timers separated for each form.
the code i have now.

for (int i =0; i < this.MdiChildren.Length;i++)

{

Form tempChild = (Form)this.MdiChildren;

if (this.combo1.Text.ToString() == tempChild.Text.ToString())

{

MessageBox.Show(tempChild.Name.ToString());

MessageBox.Show(tempChild.Controls[0].Name.ToString());

MessageBox.Show(tempChild.Controls.Count.ToString());

}

else

{

MessageBox.Show("select a start program");

}

}

But it seems that a timer is'nt a control.

there are 2 controls on that form

a datagrid and a timer.

Why won't it show the timer?

or might there be another way to do this

regards Maarten
 
M

Maarten

Hi,
i just found the solution my self
hope it helps for someone else.


//EASTING CLICKED
Form activeChild = this.ActiveMdiChild;
if(activeChild==null)
{
frmChild frm = new frmChild();
frm.MdiParent = this;
frm.Show();
int Column = 0;
frm.FillArray(Column);
}
else
{
int Column = 0;
((frmChild)this.ActiveMdiChild).FillArray(Column);
}


regards Maarten.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top