Source Code Copy, Cut, Paste, & Undo

Embed Size (px)

Citation preview

  • 7/21/2019 Source Code Copy, Cut, Paste, & Undo

    1/1

    Cut, Copy, Paste, & Undo

    Ever wanted to use the cut, copy, paste, & undo commands in your program? Now you can, check this out:

    Cut: (put this in a button)

    Clipboard.SetText Text1.SelTextText1.SelText = ""

    Copy: (put this in a button)

    Clipboard.SetText Text1.SelText

    Paste: (put this in a button)

    Text1.SelText = Clipboard.GetText(1)

    Undo: (put this in your bas)

    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPublic Const WM_UNDO = &H304

    Put this in a button:

    Call SendMessage(Text1.hwnd, WM_UNDO, 0&, 0&)