471,348 Members | 1,134 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

MDI

Hi,

I have an MDI interface.
In the parrentform i can open multiple childforms.

form program1
form program2
form program3
....
like this
DocNum++;

Worksheet.Text = "Document " + DocNum.ToString();

Worksheet.MdiParent = this;

Worksheet.Text = "Program " + DocNum;

Worksheet.Name = "Program " + DocNum;

Worksheet.Show();
the form that's loaded has a timer on it.

I'm trying to start the timer from the parentform with a startbutton in a
toolbar.
is there a way to only start the timer on the active mdichild.
or let the user choose a form where he wants the timer to start. <---- i
prefer this.

Kind regards Maarten.

Nov 28 '05 #1
5 1519
I assume that each of the forms have the timer implemented? As long as
they all have it, forget about the doc#, instead keep an arraylist of
all of the mdi windows that are open. When the user wants to start a
timer go back through the list, populate a drop down with the names of
the mdi windows, and then run the timer on the mdi they choose in the
drop down.

Maarten wrote:
Hi,

I have an MDI interface.
In the parrentform i can open multiple childforms.

form program1
form program2
form program3
....
like this
DocNum++;

Worksheet.Text = "Document " + DocNum.ToString();

Worksheet.MdiParent = this;

Worksheet.Text = "Program " + DocNum;

Worksheet.Name = "Program " + DocNum;

Worksheet.Show();
the form that's loaded has a timer on it.

I'm trying to start the timer from the parentform with a startbutton in a
toolbar.
is there a way to only start the timer on the active mdichild.
or let the user choose a form where he wants the timer to start. <---- i
prefer this.

Kind regards Maarten.


Nov 29 '05 #2
Thinking over it again, you may want to invoke the timer from the mdi
you are trying to run it on incase you have it running on a different
thread...

ArrayList[n].invoke("function", null, null)

It probably won't look exactly like that but hopefully you'll get the drift.

Benny Raymond wrote:
I assume that each of the forms have the timer implemented? As long as
they all have it, forget about the doc#, instead keep an arraylist of
all of the mdi windows that are open. When the user wants to start a
timer go back through the list, populate a drop down with the names of
the mdi windows, and then run the timer on the mdi they choose in the
drop down.

Maarten wrote:
Hi,

I have an MDI interface.
In the parrentform i can open multiple childforms.

form program1
form program2
form program3
....
like this
DocNum++;

Worksheet.Text = "Document " + DocNum.ToString();

Worksheet.MdiParent = this;

Worksheet.Text = "Program " + DocNum;

Worksheet.Name = "Program " + DocNum;

Worksheet.Show();
the form that's loaded has a timer on it.

I'm trying to start the timer from the parentform with a startbutton in a
toolbar.
is there a way to only start the timer on the active mdichild.
or let the user choose a form where he wants the timer to start. <---- i
prefer this.

Kind regards Maarten.


Nov 29 '05 #3
Hi

indeed i was planning do do this with a combobox.
but how can i call a class on a childform based on the name of that form.
because the class is named the same
or does the name of the clas shanges with the formname while creating it???

regards Maarten.
"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Thinking over it again, you may want to invoke the timer from the mdi
you are trying to run it on incase you have it running on a different
thread...

ArrayList[n].invoke("function", null, null)

It probably won't look exactly like that but hopefully you'll get the drift.
Benny Raymond wrote:
I assume that each of the forms have the timer implemented? As long as
they all have it, forget about the doc#, instead keep an arraylist of
all of the mdi windows that are open. When the user wants to start a
timer go back through the list, populate a drop down with the names of
the mdi windows, and then run the timer on the mdi they choose in the
drop down.

Maarten wrote:
Hi,

I have an MDI interface.
In the parrentform i can open multiple childforms.

form program1
form program2
form program3
....
like this
DocNum++;

Worksheet.Text = "Document " + DocNum.ToString();

Worksheet.MdiParent = this;

Worksheet.Text = "Program " + DocNum;

Worksheet.Name = "Program " + DocNum;

Worksheet.Show();
the form that's loaded has a timer on it.

I'm trying to start the timer from the parentform with a startbutton in a toolbar.
is there a way to only start the timer on the active mdichild.
or let the user choose a form where he wants the timer to start. <---- i prefer this.

Kind regards Maarten.


Nov 29 '05 #4
Are all of the child forms from the same class? if that's the case it
would be like this

(class) ArrayList[n].timerfunction();

or like I said earlier

ArrayList[n].invoke...
Nov 29 '05 #5
Hi,
Im trying to understand what you are saing but
the timerfuncton and the classes are all named the same becouse
it's the same class/form.

thanks fot the reply's.

"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:43**************@pocketrocks.com...
Are all of the child forms from the same class? if that's the case it
would be like this

(class) ArrayList[n].timerfunction();

or like I said earlier

ArrayList[n].invoke...

Nov 29 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
1 post views Thread by Ronak mishra | 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.