473,326 Members | 2,438 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.

mouse event won't fire again until click on other cell

Hi,

I need the MouseDown event be trigged everytime when you press mouse in a
datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode
for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original
again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 10 '06 #1
2 2575
Hi there Ryan,

I tried this out and and it seems to work for me. I implemented

private void dataGridView_MouseClick(object sender, MouseEventArgs e)

and evertime I click any cell, even if the cell is already selected, the
MouseClick event is fired. Is this what you are doing? If it is, and you're
still having problems, then could you provide me with some more detail?
Thanks!

"Ryan Liu" wrote:
Hi,

I need the MouseDown event be trigged everytime when you press mouse in a
datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode
for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original
again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 10 '06 #2
Thanks Justin.

Actually later I solved it by change from MouseDown to MouseUp event, and at
the end of event, I change current cell to another cell. This trick won't in
MouseDown event.

While I test Click event for System.Windows.Forms.DataGrid, I found it even
won't fire for the cell, only fired when I click on row headers.

Thanks again!
Ryan
"Justin Swan (MSFT)" <Ju************@discussions.microsoft.com> дÈëÓʼþ
news:1B**********************************@microsof t.com...
Hi there Ryan,

I tried this out and and it seems to work for me. I implemented

private void dataGridView_MouseClick(object sender, MouseEventArgs e)

and evertime I click any cell, even if the cell is already selected, the
MouseClick event is fired. Is this what you are doing? If it is, and you're still having problems, then could you provide me with some more detail?
Thanks!

"Ryan Liu" wrote:
Hi,

I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original cell again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 11 '06 #3

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

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
16
by: Niels Jensen | last post by:
I have been developing a little project which draw's a hexgrid on a panel within a form similar to this - it:s used as a client from a e-mail based strategy game: ____ ____ / \...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
1
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). Hi, I need the MouseDown event be trigged everytime when press mouse in a...
2
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
5
kadghar
by: kadghar | last post by:
Most of the times VBA is used with variables. Objects (such as worksheets, cells or databases) are only used when we read their properties (value, formula, font...) or we use a method (save,...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.