Ok,
I've searched long and hard for this question, and I can't quite figure it out. I'm new to C#, have a bit of background in VB/VB.NET, so bear with me...
I'm trying to start/stop a timer on my main form (Form1) from (let's call it) Form2.
I have no problem changing properties on any other forms, ie: form3 control properties from form1 or 2). I've run into a snag now that I'm trying to start/stop my timer which happens to be on the main form.
I've set the modifier on the timer control to public, but it won't show up. From what I've read the main form isn't like other form objects. I don't quite grasp that concept? This whole Class/Object Orientated programming thing is new.
All I want to do is start/stop the timer control on form1 from a button on form2.
Thanks.
Jeff.
Loading
theLizardPosted Oct 8, 2010, 1:51 AM
without doing a lot of wok myself I think all you need to do is declare a public method like
public void startstoptimer(bool state)
{
timer.enabled = state;
}
to use;
Form1.startstoptimer(true);
this should work ok..
Sam HobbsPosted Oct 8, 2010, 1:44 AM
My guess is that the problem is much easier to solve than you think and you can solve the problem yourself if you read the documentation and/or relevant articles and/or sample code, and I cannot help anymore without some relevant information.
Pasan RatnayakePosted Oct 7, 2010, 11:59 PM
I wrote a simple application to solve your problem. The way I have done is not the best, but it is the easiest =)
I think if I try to teach you the basics of OOP, I will bore you to death, so make sure to read up and try few simple applications.
Hope this helps.