Re: Send Mouse Click to Row that is highlighted with Arrow Key Down/Up
What is it that you actually want? Obviously wanting a mouse click for it's own sake is pointless. You want some result that you think a mouse click will achieve. What is that result?
Re: Send Mouse Click to Row that is highlighted with Arrow Key Down/Up
Originally Posted by jmcilhinney
What is it that you actually want? Obviously wanting a mouse click for it's own sake is pointless. You want some result that you think a mouse click will achieve. What is that result?
Yes, there is a reason for this and I should have included it. Currently when I click on a row on the datagridview a calculation is performs that subtracts 2 dates and is displayed on lblDaysleft.Text. This is done in the Datagridview click event.
Details:
When the datagridview is loaded it populates the corresponding textboxes. One of those text boxes has a Warranty End Date (txtWRRTYEnd2.Text). I have the following code in the DatagridviewCell Click that calculates the remaining days of the warranty and displays it on the lblDaysleft.Text.
This code works as should when I click on the datagridview.
What I would like is that when a rows is highlighted when press Arrow key Down/Up to also perform the calculation.
Any suggestions is appreciated.
Please view attachment:
Private Sub dgvEdit_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvEdit.CellClick
'Assigns the variable the date from a labeltextbox that loads
Dim todaysdate As DateTime = Me.lblTodayDate.Text
'declares variable and assigns the text value of textbox
Dim WrrtyEnddate As DateTime = Me.txtWRRTYEnd2.Text
Dim Daysleft as Int32 = WrrtyEnddate.Subtract(todaysdate).Days
Dim Results As String = Convert.ToString(Daysleft)
'displays the days left on the warranty
lblDaysleft.Text = Results