473,593 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing datagrid events | Double click and mouse move

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?

The basic thing for which I have captured the mouse move event is the fact
that I need to display a tooltip when the mouse rolls over a certain column
in the datagrid. If capturing double click after mouse move is improbable,
then what approach shall I take in order to facilitate both the scenarios?

Any pointers are gladly appreciated.

Cheers!
Nick
Nov 25 '05 #1
5 4726

your can do a double click on your datagrid

do something like this (vb.net)
Private Sub dtgrid_MouseUp( ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles dtgrid.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTes tInfo = dtgrid.HitTest( pt)
If hti.Type = DataGrid.HitTes tType.Cell Then
dtgrid.CurrentC ell = New DataGridCell(ht i.Row, hti.Column)
dtgrid.Select(h ti.Row)
End If
If dubbelklik = True Then
dowhatyouwant()
Else
dubbelklik = True
End If
End Sub
greets,

if this post was helpfull, click on the bottom of the post on yes :-p
"Nick" wrote:
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?

The basic thing for which I have captured the mouse move event is the fact
that I need to display a tooltip when the mouse rolls over a certain column
in the datagrid. If capturing double click after mouse move is improbable,
then what approach shall I take in order to facilitate both the scenarios?

Any pointers are gladly appreciated.

Cheers!
Nick

Nov 25 '05 #2
But then how can i set the dubbelklik variable?
That, actually speaking, is not the double click event...its just a mouse up.
Any more points around it?

"interwande rer" wrote:

your can do a double click on your datagrid

do something like this (vb.net)
Private Sub dtgrid_MouseUp( ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles dtgrid.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTes tInfo = dtgrid.HitTest( pt)
If hti.Type = DataGrid.HitTes tType.Cell Then
dtgrid.CurrentC ell = New DataGridCell(ht i.Row, hti.Column)
dtgrid.Select(h ti.Row)
End If
If dubbelklik = True Then
dowhatyouwant()
Else
dubbelklik = True
End If
End Sub
greets,

if this post was helpfull, click on the bottom of the post on yes :-p
"Nick" wrote:
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?

The basic thing for which I have captured the mouse move event is the fact
that I need to display a tooltip when the mouse rolls over a certain column
in the datagrid. If capturing double click after mouse move is improbable,
then what approach shall I take in order to facilitate both the scenarios?

Any pointers are gladly appreciated.

Cheers!
Nick

Nov 25 '05 #3

Look at the code.

when you do a mouse up on the datagrid... it checks wich cell you have
selected... then the dubbelklik variable is set to "true"... the second time
you click on it you click on the same cell you execute another function. all
you need extra is a timer to set the time of your click event.

works great for me.

"Nick" wrote:
But then how can i set the dubbelklik variable?
That, actually speaking, is not the double click event...its just a mouse up.
Any more points around it?

"interwande rer" wrote:

your can do a double click on your datagrid

do something like this (vb.net)
Private Sub dtgrid_MouseUp( ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles dtgrid.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTes tInfo = dtgrid.HitTest( pt)
If hti.Type = DataGrid.HitTes tType.Cell Then
dtgrid.CurrentC ell = New DataGridCell(ht i.Row, hti.Column)
dtgrid.Select(h ti.Row)
End If
If dubbelklik = True Then
dowhatyouwant()
Else
dubbelklik = True
End If
End Sub
greets,

if this post was helpfull, click on the bottom of the post on yes :-p
"Nick" wrote:
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?

The basic thing for which I have captured the mouse move event is the fact
that I need to display a tooltip when the mouse rolls over a certain column
in the datagrid. If capturing double click after mouse move is improbable,
then what approach shall I take in order to facilitate both the scenarios?

Any pointers are gladly appreciated.

Cheers!
Nick

Nov 25 '05 #4
Gee thanx!!!!

You're the man!!!!
This solved a lot of other stuff as well. Now that I'm not capturing the
double click event, I got rid of a couple of bugs wherein even double
clicking the header or the empty area in the grid was resulting in the action
to be performed only on clicking the cells.

Cheers!

"interwande rer" wrote:

Look at the code.

when you do a mouse up on the datagrid... it checks wich cell you have
selected... then the dubbelklik variable is set to "true"... the second time
you click on it you click on the same cell you execute another function. all
you need extra is a timer to set the time of your click event.

works great for me.

"Nick" wrote:
But then how can i set the dubbelklik variable?
That, actually speaking, is not the double click event...its just a mouse up.
Any more points around it?

"interwande rer" wrote:

your can do a double click on your datagrid

do something like this (vb.net)
Private Sub dtgrid_MouseUp( ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles dtgrid.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTes tInfo = dtgrid.HitTest( pt)
If hti.Type = DataGrid.HitTes tType.Cell Then
dtgrid.CurrentC ell = New DataGridCell(ht i.Row, hti.Column)
dtgrid.Select(h ti.Row)
End If
If dubbelklik = True Then
dowhatyouwant()
Else
dubbelklik = True
End If
End Sub
greets,

if this post was helpfull, click on the bottom of the post on yes :-p
"Nick" wrote:

> 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?
>
> The basic thing for which I have captured the mouse move event is the fact
> that I need to display a tooltip when the mouse rolls over a certain column
> in the datagrid. If capturing double click after mouse move is improbable,
> then what approach shall I take in order to facilitate both the scenarios?
>
> Any pointers are gladly appreciated.
>
> Cheers!
> Nick

Nov 26 '05 #5

Great !

I'm glad that it was helpfull.

"Nick" wrote:
Gee thanx!!!!

You're the man!!!!
This solved a lot of other stuff as well. Now that I'm not capturing the
double click event, I got rid of a couple of bugs wherein even double
clicking the header or the empty area in the grid was resulting in the action
to be performed only on clicking the cells.

Cheers!

"interwande rer" wrote:

Look at the code.

when you do a mouse up on the datagrid... it checks wich cell you have
selected... then the dubbelklik variable is set to "true"... the second time
you click on it you click on the same cell you execute another function. all
you need extra is a timer to set the time of your click event.

works great for me.

"Nick" wrote:
But then how can i set the dubbelklik variable?
That, actually speaking, is not the double click event...its just a mouse up.
Any more points around it?

"interwande rer" wrote:

>
> your can do a double click on your datagrid
>
> do something like this (vb.net)
>
>
> Private Sub dtgrid_MouseUp( ByVal sender As Object, ByVal e As
> System.Windows. Forms.MouseEven tArgs) Handles dtgrid.MouseUp
> Dim pt = New Point(e.X, e.Y)
> Dim hti As DataGrid.HitTes tInfo = dtgrid.HitTest( pt)
> If hti.Type = DataGrid.HitTes tType.Cell Then
> dtgrid.CurrentC ell = New DataGridCell(ht i.Row, hti.Column)
> dtgrid.Select(h ti.Row)
> End If
> If dubbelklik = True Then
> dowhatyouwant()
> Else
> dubbelklik = True
> End If
> End Sub
>
>
> greets,
>
> if this post was helpfull, click on the bottom of the post on yes :-p
>
>
> "Nick" wrote:
>
> > 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?
> >
> > The basic thing for which I have captured the mouse move event is the fact
> > that I need to display a tooltip when the mouse rolls over a certain column
> > in the datagrid. If capturing double click after mouse move is improbable,
> > then what approach shall I take in order to facilitate both the scenarios?
> >
> > Any pointers are gladly appreciated.
> >
> > Cheers!
> > Nick

Nov 26 '05 #6

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

Similar topics

5
6214
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on buttons, which is fine most of the time (he comes from a Mac environment, so I accept mouse clicks from the right or left button when he's working on the PC). But every once in a while, he'll press and hold the right mouse button, move onto a JButton,...
0
3170
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some text. Before changing to another cell in the DataGrid, I move my mouse pointer off the DataGrid and change the selected item in a ListBox or TreeView. Here's my question Which should fire first, the DataTable's RowChanged/CellChanged event or...
3
9211
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I click on a row (withs will turn blue then) and then click on it again . Now if I press any key the event will fire (except for the arrow keys). I also tried to override the IsInputKey => no luck. I also tried to override the ProcessCmdKey => With...
2
1857
by: Snig | last post by:
Hi, I want to sort the DataGrid according to the number of clicks of mouse on the column-header link. e.g. if user clicks on the header once - it will be sorted ASC if the header is double-clicked - it will be sorted DESC It is not exactly toggling the sorting-order. I have seen a lot of messages and articles in the web about toggling the sort order (like first time click
1
4300
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
3
2060
by: jcrouse | last post by:
I have created a form designer type application (with a lot of you peoples helpJ). It has label controls that are draggable at runtime. The user is also allowed to change some properties such as forecolor, backcolor and font. The labels also are rotatable and the text can also be flipped 180 degrees (the flipped text part is still being worked on). I have one context menu for all 30 labels that allows for the property changes to the labels....
2
3477
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.
1
2409
by: trint | last post by:
Hi, I have three datagrids in a WinForm. I want dataGridView1 to retrieve data and make dataGridView2 visible and the same with dataGridView3. Any help is appreciated. Thanks, Trint
3
4564
by: wbyeats | last post by:
Hi, I would like to enable my VC++ application to capture general mouse and keyboard events (click, double-click, key press) that occur outside of my application's frame (eg. clicking inside the frame of another application). I'm quite sure this is possible, but I don't know how to do it. Anyone have experience with this? Thanks in advance for your help.
0
7935
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
8236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8366
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...
1
7995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3851
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
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2379
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1202
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.