C# call method constantly?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CopperCircle
    New Member
    • Aug 2008
    • 2

    #1

    C# call method constantly?

    Hi, I have the following method that checks the state of a checkbox on another form, how can I call this method constantly? or when the user press the mouse?

    public void Test()
    {
    if (Form2.cb.Check ed)
    {
    Form1.tb.Text = "YES";
    videoCogControl 1.Play();
    }
    }

    Thanks.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Code:
          while(true)
          {               
                if (Form2.cb.Checked)
                {
                    Form1.tb.Text = "YES";
                    videoCogControl1.Play();
                }
          }
    that constantly keeps checking !!!

    You shud however link to an event which wil disable it.

    Something like stop a timer which activatres the checking, when the checkbox is unchecked.

    moreover even if the control is located in another form, and you have set it to public, you can access the click event for that checkbox

    Comment

    Working...