Wednesday, 27 May 2009

Textbox handling control-C copy/paste

Another nice easy bit of code for this:

Private Sub outputbox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles outputbox.KeyPress
If e.KeyChar = Convert.ToChar(1) Then
DirectCast(sender, TextBox).SelectAll()
e.Handled = True
End If
End Sub

No comments:

Post a Comment