473,383 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

i have to know what button of mouse clicked...

panel has not Key press event... that's why..
if i have to figure invoking any event out when panel clicked

it is so difficult...what button is clicked ....

button of Mouse like .. Left, Middle, and Right...

how can i distiguish...
i have to use Click event because panel has not key events...

private void panScreen_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouse = (MouseEventArgs)sender; // Error...
if (mouse.Button == MouseButtons.Left)
{

}
Nov 16 '05 #1
1 1833
DotNetMania <km*****@msn.com> wrote:
panel has not Key press event... that's why..
if i have to figure invoking any event out when panel clicked

it is so difficult...what button is clicked ....

button of Mouse like .. Left, Middle, and Right...

how can i distiguish...
i have to use Click event because panel has not key events...

private void panScreen_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouse = (MouseEventArgs)sender; // Error...
if (mouse.Button == MouseButtons.Left)
{

}


From the docs to Control.Click:

<quote>
The Click event passes an EventArgs object to its event handler, so it
only indicates that a click has occurred. If you need more specific
mouse information (button, number of clicks, wheel rotation, or
location), use the MouseDown and MouseUp events which pass a
MouseEventArgs object to the event handler.
</quote>

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dawn | last post by:
Hi, I have a form with 4 buttons on it. Now when the user presses enter....i always want the button2_click event to be fired, no matter what button was last clicked on by the mouse. However if...
3
by: Chris Dunaway | last post by:
I have derived a class from the System.Windows.Forms.Button class in order to draw the button differently. Among other things, I paint the background of the button in the OnPaing override. ...
16
by: Stuart | last post by:
I have a page where I utilise the left and right cursor keys to change an image, also on this page is a groups of radio buttons, unfortunately when a radio button is clicked the focus for the...
1
by: Jon | last post by:
I am designing a form that needs to be able to hide one button when that button is clicked and show another button. I have it fully working for IE but in Netscape 7 once the button is clicked and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.