QUOTE(killnine @ 6 Aug, 2007 - 07:20 AM)

Howdy guys,
Silly question but here goes.
I have two classes. One is called "signal_chart" and the other is called "graph1".
I have a timer in "graph1" and wish to start and stop the timer from within "signal_chart". I have created methods (public) to start and stop the timer and tried to call said methods within signal_chart, but to no avail (e.g. - graph1.start_Timer(), from within "signal_chart")
I have done this before between two custom methods (actually, I have done it in the same class).
What am I doing wrong?
My quick solution was to call the "namespace.class.method", and that would work.
However, I am creating multiple instances of the "graph1" form. Therefore, I need to modify specific timers of a particular instance.
for example:
CODE
graph1_form = new graph1();
graph1_form.Show();
//now I want to call a method within graph1_form, which is an
//instance of the graph1 form
graph1_form.graph1_Timer.stop();
//however, the above code does not work. Why?
QUOTE(PsychoCoder @ 6 Aug, 2007 - 07:37 AM)

QUOTE(killnine @ 6 Aug, 2007 - 07:20 AM)

Howdy guys,
Silly question but here goes.
I have two classes. One is called "signal_chart" and the other is called "graph1".
I have a timer in "graph1" and wish to start and stop the timer from within "signal_chart". I have created methods (public) to start and stop the timer and tried to call said methods within signal_chart, but to no avail (e.g. - graph1.start_Timer(), from within "signal_chart")
I have done this before between two custom methods (actually, I have done it in the same class).
What am I doing wrong?
Can you post the code for the start_Timer method, and how you're calling it in signal_chart please
Sorry for doublepost.
When I load the "graph1" form, it starts the timer
CODE
graph1_timer.Interval = 100;
graph1_timer.Enabled = true;
graph1_timer.Start();
Then, I have another method to STOP the timer
CODE
public void graph1_timer_Stop(object sender, EventArgs e)
{
graph1_timer.Stop();
}
What I want to do is create instances of this form ("graph1") and be able to access their timers from another class ("signal_chart").