Formtransparent




Private Declare Function SetWindowLong Lib "User" (ByVal hWnd as Integer, ByVal nIndex as Integer, ByVal dwNewLong) As Long

Const WS_EX_TRANSPARENT = &H20& Const GWL_EXSTYLE = (-20)

Description of Parameters:

ByVal hWnd = The handle of the Window which you want to make transparent ByVal nIndex = An integer value describing the type of information you want to set ByVal dwnewLong = The mode for the Form Transparent
Start a New Project , Form1 is created by default, Add a command button named Command1 to this form, then Add another form to the Project (Form2), add the above Function Declaration & the Constants to the Form2 General Declarations section.
Actual Code:


'in the Form1 , Command Button1 Click Add the Following Code

Private Sub Command1_Click()
Form2.Show
End Sub


'in the Form2 Load event Add the Following Code

Private Sub Form_Load()
Dim retval as Long retval = SetWindowsLong(Form2.hWnd,GWL_EXSTYLE,WS_EX_TRANSPARENT)
End Sub










( formtransparent.html )- by Paolo Puglisi - Modifica del 17/12/2023