Results 1 to 8 of 8

Thread: [RESOLVED] [2.0] count mouseclicks ?

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] count mouseclicks ?

    You should create a single method to handle the MouseClick event for every control on your form plus the form itself. In that method you would simply increment an integer variable declared at the class level and then display that value in your Label.

    To create the event handler you should select the form in the designer and then go to the Properties window and press the Events button. Now double-click the MouseClick event to create the event handler. Now go back to the form and type Ctrl+A to select all your controls. Go back to the Properties window and select the method you previously created from the drop-down list for the MouseClick event. If that event is not listed it means that you have selected at least component that doesn't support that event, so you must manually deselect each one of those first. Alternatively you can deselect all and manually select each one that does support that event.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Location
    Denmark
    Posts
    67

    Re: [2.0] count mouseclicks ?

    sry but it aint much that i understand from what you said, im danish and aint that good to complicated english... could you just give me a little code examble and show how to detect the clicks, something like

    Code:
            private void Form1_MouseClick(object sender, MouseEventArgs e)
            {
                label1.text *= 1;
            }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width