| | |
Control Transparant Form
Thread Solved |
you mean the form can be change like opacity.If i right then try this following code :
add this following code to module :
you can call the function like this :
you can change text box with other control to get value as percent
Ok. Hope it helps..
add this following code to module :
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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 :
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Transparant Form1.hwnd, val(txtPercent.text), true
Ok. Hope it helps..
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: need help in game
- Next Thread: add to combo box from access with where statment
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






