Hello All,
I am using a UltraWinGrid and i have implemented one cell of the grid to show email addresses as hyperlink .Problem is that when i click any where
in the cell it opens an outlook instance for me i want it should open the outlook only when i click on the email address not when i click any where in the cell (which may be the empty region left after the email address) for e.g *Prabhatc@cybage.com * here i want outlook to open when i click
onthe email address not when i click on the empty region of the cell .I am using this code.
Private Sub ContactsUltraGrid_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ContactsUltraGrid.MouseDown 'Implemented functionality on left click of mouse Dim mousePoint As System.Drawing.Point = New System.Drawing.Point(e.X, e.Y) Dim element As Infragistics.Win.UIElement = CType(sender, Infragistics.Win.UltraWinGrid.UltraGrid).DisplayLayout.UIElement.ElementFromPoint(mousePoint) Dim cell As Infragistics.Win.UltraWinGrid.UltraGridCell = CType(element.GetContext(GetType(Infragistics.Win.UltraWinGrid.UltraGridCell)), Infragistics.Win.UltraWinGrid.UltraGridCell) If cell Is Nothing Then Return If e.Button = System.Windows.Forms.MouseButtons.Left Then 'Here we figure out whether we have clicked on email link if yes then open outlook If cell.Column.Key = "Email" Then Dim strEmail As String = cell.Tag.ToString() If (strEmail.Trim().Length > 0) Then strEmail = "MailTo:" & strEmail 'Open OutLook System.Diagnostics.Process.Start(strEmail) End If End If End If End Sub
Please respond me..
Thanks a Lot,
Regards,
Prabhat Chauhan
Maybe you could trap the MouseDown event of the grid and store the last button that was used.
Thanks a lot mike but in the Link Clicked how can i defrentiate between right click and left mouse click like
e.Button = System.Windows.Forms.MouseButtons.Left
In link Clicked event .I am not able to use e.button please provide a work around for this .I am using this in mouse down to check if i clicked left click then only open email instance and on right click i want to perform other operation.
Here the event event Link Clicked always launched whether i clicked left or right.
Hi,
Here's what you can do:
Please Respond if anybody knows ....