salve
nel mio progetto ho vari form, form1-form2- etc;
in ogni form ho inserito dei richtextbox ke diventano trasparenti
con il seguente codice inserito in tutti i form:
codice:
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GWL_EXSTYLE = (-20)
Const WS_EX_TRANSPARENT = &H20&
Private Sub Form_Load()
Dim Control As Control
Dim result As Long
For Each Control In Form1.Controls
If TypeOf Control Is RichTextBox Then
result = SetWindowLong(Control.hWnd, GWL_EXSTYLE, WS_EX_TRANSPARENT)
'set Richtext Box Backgroundstyle to Transparent
End If
Next Control
End Sub
per non ripetere in ogni form lo stesso codice posso usare le stesse linee di codice in un modulo?
e come devo modificare il codice?
grazie e buona domenica a tutti