Hi guys/gals,
i need to make transparant form and it can be changing by user. i stuck cause i didn't know how to start..

OK.Best Regards..

you mean the form can be change like opacity.If i right then try this following code :
add this following code to module :

Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long,ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long,ByVal nIndex As Long,ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long,ByVal nCmdShow As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long,ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_LAYERED As Long = &H80000
Private Const LWA_ALPHA As Long = &H2

Public Function Transparant(hwnd As Long, percent As Integer,pil As Boolean)
	Dim before as Long
	before = GetWindowLong(hwnd,GWL_EXSTYLE)
	If pil = true then
		before = before Or WS_EX_LAYERED
		SetWindowLong hwnd, GWL_EXSTYLE, before
		SetLayeredWindowAttributes hwnd, 0, 255 * (percent / 100), LWA_ALPHA
	Else
		before = before And Not WS_EX_LAYERED
		SetWindowLong hwnd, GWL_EXSTYLE, before
	End If
End Function

you can call the function like this :

Transparant Form1.hwnd, val(txtPercent.text), true

you can change text box with other control to get value as percent

Ok. Hope it helps..

Comments
confusing but this a nice code
really complex

wow thanks all for excellent reply...
thanks jx_man your code running nice..

This question has already been answered. Start a new discussion instead.