471,306 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

controls on child

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[i];

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
Nov 29 '05 #1
1 1267
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.

"Maarten" <gu******@hotmail.com> wrote in message
news:43**********************@news.skynet.be...
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[i];

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

Nov 29 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bill yeager | last post: by
9 posts views Thread by antonyliu2002 | last post: by
3 posts views Thread by Mike Collins | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.