473,326 Members | 2,128 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,326 software developers and data experts.

Help me with this odd mouse click problem

I have a DataGrid which I added a MouseUp event:

datagrid.MouseUp += new MouseEventHandler(onMouseUp);

which simply does:

if (e.Button == MouseButtons.Right) {
if(hti.Type == DataGrid.HitTestType.ColumnHeader) {
main_dg.ContextMenu = columnHeaderMenu;
} else if (hti.Type == DataGrid.HitTestType.Cell) {
main_dg.ContextMenu = leftClickCellMenu;
}
}

Now, this once worked fine, but lately something really odd has been
happening...

It seems to use the mouse coordinates of the LAST click... not the current
click- what in the world could cause that?

So for example, when I first load the dialog and right click the column
header, nothing happens. Then if I right-click a Cell, the Column Header menu
pops up. If I then right-click the column header, the Cell context menu pops
up! Whatever I last clicked seems to be the current target...

Why??
Nov 16 '05 #1
1 1179

Some more information:

I mad eit output the coords:

Console.WriteLine("Point is {0},{1}", e.X, e.Y);

and it turns out the coordinates given by MouseEventArgs is giving my
function the coords of the last mouse click

Under what circumstances would the mouse event give coordinates of the last
mouse event instead of the current one, and saving the current one for the
next event?? I am not doing anything crazy on this dialog... this is really
the only event I'm using on this Form and no other Forms even touch Mouse
Events

This is very strange
Nov 16 '05 #2

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

Similar topics

3
by: Gary Mayor | last post by:
Hi, I'm re phrasing and earlier question as the earlier question doesn't make to much sense. I using document.onmousemove to move a <div line on the screen. At the moment if I click and move the...
12
by: mdb | last post by:
My app has a notify icon in the systray. I want the left mouse click to initiate a menu, and a right-mouse click to do something else. Normally, for a button, I would listen to MouseDown and if I...
5
by: A-PK | last post by:
Hi, I am using treeview as my menu. my menu is like the following + Users & Groups - Users -Groups + Departmenuts - Engineering
0
by: lechatthierry | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
1
by: Neko | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
0
by: Millhouse50 | last post by:
I am having this problem where when I run my web application and then click with the mouse on the first textbox on the page, my previous button on my wizard control gets focus. Now I tried to set...
3
by: Morten Snedker | last post by:
If I have a number of random applications open, move the mouse cursor to a given position and do a click, the application gets the focus. That is what this simple code should illustrate: Dim...
1
by: johnix | last post by:
i am a bigenner in this field of web programming.. i like to create a dynamic dropdown menu that the data should came from the database but i dont know how to do it. what i did is I use the table and...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
3
by: crochunter | last post by:
Hi, I have to add a mouse over event and mouse click event in my rectangles that I draw while taking the values from an input file. Now since I am taking rectangle height and width from the input...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.