C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Handle MouseEvents using c# dot net


Posted Date: 06 Sep 2008    Resource Type: Articles    Category: Web Applications

Posted By: Ashutosh Kumar       Member Level: Gold
Rating:     Points: 10



Handling MouseEvents

You can handle various Mouse actions by using the events specified in the Control class. The following listing shows how to handle a simple MouseUp Event:
Listing – 2

using System;
using System.Windows.Forms;
using System.Drawing;

public class Mousedemo:Form {

public Mousedemo() {

this.MouseUp += new MouseEventHandler(OnMouseup);

}

public void OnMouseup(object sender,MouseEventArgs e) {

this.Text = "Current Position (" +e.X + " , " + e.Y +")";

}

public static void Main() {

Application.Run(new Mousedemo());

}
}

Try out the above example and observe the result. Click, DoubleClick, MouseEnter, and MouseLeave events can be handled in a similar way.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Handling MouseEvents  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Themes and Skins
Previous Resource: how to send a mail from c# application
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use