Cortar, copiar y pegar...

¿Cómo lo puedo hacer amigo?

1 respuesta

Respuesta
1
Encontré para ti el siguiente código...
Seleccionar todo el texto:
Text1. SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Copiar texto:
Clipboard. Clear
Clipboard. SetText Text1. SelText
Text1. SetFocus
Pegar texto:
Text1.SelText = Clipboard.GetText()
Text1. SetFocus
Cortar texto:
Clipboard. SetText Text1. SelText
Text1.SelText = ""
Text1. SetFocus
Deshacer texto: (Nota: esta operación sólo es eficaz con el control Rich TextBox).
En un módulo copie esta línea:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Esta es la instrucción de la función deshacer:
UndoResultado = SendMessage(Text1.hwnd, &HC7, 0&, 0&)
If UndoResultado = -1 Then
Beep
MsgBox "Error al intentar recuperar.", 20, "Deshacer texto"
End If
Seleccionar todo el texto:
SendKeys "^A"
Copiar texto:
SendKeys "^C"
Pegar texto:
SendKeys "^V"
Cortar texto:
SendKeys "^X"
Deshacer texto:
SendKeys "^Z"

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas