473,657 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2599
Hi there Ryan,

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

private void dataGridView_Mo useClick(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.mi crosoft.com> дÈëÓʼþ
news:1B******** *************** ***********@mic rosoft.com...
Hi there Ryan,

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

private void dataGridView_Mo useClick(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
7476
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 it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the frontend) will stop firing until the user gives the form focus. (Note that the update itself always...
16
1953
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,0) \____/ (2,0) \____/ \ / \ / \ \____/(1,1) \____/ (3,1) \_ / \ / \ / (0,1) \____/ (2,1) \____/
0
2432
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 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that article and recreated the situation I see in my application. (Code included below.) If you run the...
5
4734
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 gets triggered and the double click is not identified at all. Is there any way I can invoke the double click when the mouse move also exists?
1
1588
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 datagrid (System.Windows.Forms).
2
3489
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 using data in this row before actually remove it from datagrid. I can certainly control with Delete button. But if I want to allow the user to use Del key on the keyboard, I lost this kind control.
9
2465
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 post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
5
24352
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, open...). But their events are rarely used, and mainly when working with MS Forms. Excel has two very important object types: Workbook and Worksheet, which besides their properties and methods, they have events. The Worksheet's events are not shown in...
2
3124
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 same column then mouseup anywhere in a cell. The mouseup event sometimres fires before the selection of table cells by dragging is complete. It's important that I stop these "false" mouseup's from firing or distinguish them from when I let go of...
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.