I have a gridview which is filled by a query. I want to allow the user to highlight and copy text from the cell, which is double clicked. here is my event code:
Private Sub datagridview2_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles datagridview2.CellDoubleClick
datagridview2.SelectionMode = DataGridViewSelectionMode.CellSelect
datagridview2.CurrentCell.Selected = True
datagridview2.ReadOnly = False
datagridview2.BeginEdit(False)
End Sub
This works fine with the exception that the user is allowed to change text. I just want to let him highlight the text and copy and paste it. I guess it is an easy edit control but i dont know it yet. Can somebody help out?
Edit: I removed the word paste because it sound confusing. Here is an example: cell value: "5 dublettes found: 11111, 22222,33333,44444,5555" I want to make it possible to only highlight 33333 and copy it via strg+c. With the premise, that the cell value is not changable.
Friendly greetings
b101