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 5 4698
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.MouseEventArgs) Handles dtgrid.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = dtgrid.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
dtgrid.CurrentCell = New DataGridCell(hti.Row, hti.Column)
dtgrid.Select(hti.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
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?
"interwanderer" 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.MouseEventArgs) Handles dtgrid.MouseUp Dim pt = New Point(e.X, e.Y) Dim hti As DataGrid.HitTestInfo = dtgrid.HitTest(pt) If hti.Type = DataGrid.HitTestType.Cell Then dtgrid.CurrentCell = New DataGridCell(hti.Row, hti.Column) dtgrid.Select(hti.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
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?
"interwanderer" 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.MouseEventArgs) Handles dtgrid.MouseUp Dim pt = New Point(e.X, e.Y) Dim hti As DataGrid.HitTestInfo = dtgrid.HitTest(pt) If hti.Type = DataGrid.HitTestType.Cell Then dtgrid.CurrentCell = New DataGridCell(hti.Row, hti.Column) dtgrid.Select(hti.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
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!
"interwanderer" 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?
"interwanderer" 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.MouseEventArgs) Handles dtgrid.MouseUp Dim pt = New Point(e.X, e.Y) Dim hti As DataGrid.HitTestInfo = dtgrid.HitTest(pt) If hti.Type = DataGrid.HitTestType.Cell Then dtgrid.CurrentCell = New DataGridCell(hti.Row, hti.Column) dtgrid.Select(hti.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
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!
"interwanderer" 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?
"interwanderer" 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.MouseEventArgs) Handles dtgrid.MouseUp > Dim pt = New Point(e.X, e.Y) > Dim hti As DataGrid.HitTestInfo = dtgrid.HitTest(pt) > If hti.Type = DataGrid.HitTestType.Cell Then > dtgrid.CurrentCell = New DataGridCell(hti.Row, hti.Column) > dtgrid.Select(hti.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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
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...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
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...
|
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)...
| |