Allora io riesco a disegnare su un picture box con questo codice
e riesco a inserire una picture box in un Rich Text Box con questo codicecodice:Dim Drawing As Boolean Private Sub Form_Load() Drawing = False End Sub Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) Drawing = False End Sub Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Drawing = True Picture1.DrawWidth = 9 Picture1.ForeColor = RGB(VScrollRed, VScrollGreen, VScrollBlue) Picture1.PSet (x, y) End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) If Drawing = True Then Picture1.Line -(x, y) End Sub
in un modulo
e con questo nel formcodice: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
ma nel Rich TExt Box non inserisce il disegno che ho fatto nella picture..qualcuno sa aiutarmi?codice: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_PASTE = &H302 Sub InsertPicInRTB(ByVal RTB As RichTextBox, ByVal Pic As StdPicture) Clipboard.Clear Clipboard.SetData Pic SendMessage RTB.hwnd, WM_PASTE, 0, 0 End Sub Private Sub Command2_Click() InsertPicInRTB RichTextBox1, Picture1.Image End Sub
grazie =)

Rispondi quotando