я с vb недавно...
использую rich text box понятно для чего..
для вставки в него текста из буфера хоче делать так
- Код: Выделить всё
rtftext.text=clipboard.gettext
выдает ошибку:
invalid qualifier
помогите пжалста...
rtftext.text=clipboard.gettext
Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
Select Case Button.Key
Case "New"
LoadNewDoc
Case "Open"
mnuFileOpen_Click
Case "Save"
mnuFileSave_Click
Case "Print"
mnuFilePrint_Click
Case "Cut"
'ToDo: Add 'Cut' button code.
Case "Copy"
Clipboard.SetText ActiveForm.rtfText.SelText
Case "Paste"
' ВОТ ТУТ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Case "Bold"
ActiveForm.rtfText.SelBold = Not ActiveForm.rtfText.SelBold
Button.Value = IIf(ActiveForm.rtfText.SelBold, tbrPressed, tbrUnpressed)
Case "Italic"
ActiveForm.rtfText.SelItalic = Not ActiveForm.rtfText.SelItalic
Button.Value = IIf(ActiveForm.rtfText.SelItalic, tbrPressed, tbrUnpressed)
Case "Underline"
ActiveForm.rtfText.SelUnderline = Not ActiveForm.rtfText.SelUnderline
Button.Value = IIf(ActiveForm.rtfText.SelUnderline, tbrPressed, tbrUnpressed)
Case "Align Left"
ActiveForm.rtfText.SelAlignment = rtfLeft
Case "Center"
ActiveForm.rtfText.SelAlignment = rtfCenter
Case "Align Right"
ActiveForm.rtfText.SelAlignment = rtfRight
End Select
ActiveForm.rtfText.DisableNoScroll = False
GSerg писал(а):Повторяй процедуру прочтения, последовательно проходя через стадии , , и .
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const EM_SETTARGETDEVICE = 1096
Private Sub Form_Load()
SendMessageLong RichTextBox1.hwnd, EM_SETTARGETDEVICE, 0, 1
End Sub
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Const WM_UNDO = &H304
Private Sub Command1_Click()
SendMessage Text1.hWnd, WM_UNDO, 0, 0
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 121