Historia
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
draw = True 'estamos dibujando
CurrentX = X ' cargaen la variable la ubicación en la coordenada X
CurrentY = Y ' carga en la variable la ubicación en la coordenada Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X AsSingle, Y As Single)
If draw Then Line -(X, Y) ' si la variable draw esta a verdadera 'dibuja cada uno de los puntos.
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X AsSingle, Y As Single)
draw = False 'la variable draw a falsa detiene el dibujo
End Sub
Private Sub timreloj_Timer()
Dim hoy As Variant
hoy = Now 'la fecha y hora actuales
lbldia.Caption =Format(hoy, "dddd")
lblmes.Caption = Format(hoy, "mmmm")
lblyear.Caption = Format(hoy, "yyyy")
lbldiames.Caption = Format(hoy, "d")
lblhora.Caption = Format(hoy, "h:mm:ss ampm")
End Sub
Mini editorde texto con funciones de seleccionar todo el texto, copiar texto, pegar texto...
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:...
Regístrate para leer el documento completo.