怎样对RichtextBox进行剪切、复制、删除、查找等操作,谢谢

解决方案 »

  1.   

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any ) As LongPrivate Const WM_COPY = &H301
    Private Const WM_PASTE = &H302
    Private Const WM_CUT = &H300
    Private Const WM_UNDO = &H304'撤消
    SendMessage RichtextBox1.hWnd, WM_UNDO, 0, 0
    '剪切
    SendMessage RichtextBox1.hWnd, WM_CUT, 0, 0
    '复制
    SendMessage RichtextBox1.hWnd, WM_COPY, 0, 0
    '粘贴
    SendMessage RichtextBox1.hWnd, WM_PASTE, 0, 0查找,替换那些得自己用instr或instrrev写!或调用系统的对话框