ZankuR Director
Cantidad de envíos : 107 Fecha de inscripción : 19/07/2013
| Tema: [Aporte]Transparencia en formularios - Plus Configurable Sáb Ago 10, 2013 11:48 pm | |
| Crean un formulario llamado - Código:
-
FrmInvF Crean un modulo llamado - Código:
-
Mod_InvF En el formulario crean un VScrollBar llamado - Código:
-
HScroll1 Doble clic al formulario y ponen - Código:
-
Private Sub Form_Load() HScroll1.Max = 255 HScroll1.Min = 50 HScroll1.Value = 150 End Sub Private Sub HScroll1_Change()
Call Aplicar_Transparencia(Me.hWnd, CByte(HScroll1.Value)) End Sub
Listo el formulario y ahora en el modulo invF ponen: - Código:
-
Option Explicit Private Declare Function SetLayeredWindowAttributes Lib "user32" _ (ByVal hWnd As Long, _ ByVal crKey As Long, _ ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Const GWL_EXSTYLE = (-20) Private Const LWA_ALPHA = &H2 Private Const WS_EX_LAYERED = &H80000 Public Function Is_Transparent(ByVal hWnd As Long) As Boolean On Error Resume Next Dim Msg As Long Msg = GetWindowLong(hWnd, GWL_EXSTYLE) If (Msg And WS_EX_LAYERED) = WS_EX_LAYERED Then Is_Transparent = True Else Is_Transparent = False End If If Err Then Is_Transparent = False End If End Function Public Function Aplicar_Transparencia(ByVal hWnd As Long, _ Valor As Integer) As Long Dim Msg As Long On Error Resume Next If Valor < 0 Or Valor > 255 Then Aplicar_Transparencia = 1 Else Msg = GetWindowLong(hWnd, GWL_EXSTYLE) Msg = Msg Or WS_EX_LAYERED SetWindowLong hWnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hWnd, 0, Valor, LWA_ALPHA Aplicar_Transparencia = 0 End If If Err Then Aplicar_Transparencia = 2 End If End Function https://i.imgur.com/kHXjbIs.jpg Saludos y fuente servers-argentum | |
|
WhoTeR Director de Tropas
Cantidad de envíos : 143 Fecha de inscripción : 28/07/2013
| Tema: Re: [Aporte]Transparencia en formularios - Plus Configurable Dom Ago 11, 2013 12:21 am | |
| | |
|
ZankuR Director
Cantidad de envíos : 107 Fecha de inscripción : 19/07/2013
| Tema: Re: [Aporte]Transparencia en formularios - Plus Configurable Dom Ago 11, 2013 12:31 am | |
| Para todos casi todo los mod igual que para 13.0 | |
|
Contenido patrocinado
| Tema: Re: [Aporte]Transparencia en formularios - Plus Configurable | |
| |
|