Visual Basic - Forms Trasparentes

Life is soft - evento anual de software empresarial
 
Vista:

Forms Trasparentes

Publicado por Jose Luis Solis (4 intervenciones) el 25/06/2003 01:06:39
Que tal, tengo un problema haber si me pueden ayudar.

Necesito hacer un form transparente, esto es para una pantalla de splash, lo que quiero hacer es deplegar una imagen pero quiero que el fondo sea transparente, para que me despliegue la imagen como pantalla de splash.....

de antemano les agradesco.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Forms Trasparentes

Publicado por Cecilia Colalongo (3116 intervenciones) el 25/06/2003 03:12:29
Fijate con esto a ver si te sirve:

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const WS_EX_TRANSPARENT = &H20&
Public Const GWL_EXSTYLE = (-20)
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_FRAMECHANGED = &H20
Public Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Public Const TRANSPARENT = 1
Public Declare Function InvalidateRectLong Lib "user32" Alias "InvalidateRect" (ByVal hwnd As Long, ByVal lpRect As Long, ByVal bErase As Long) As Long

Public Sub MakeFrameTransparent(ByVal fraThis As Control)
Dim lExStyle As Long
lExStyle = GetWindowLong(fraThis.hwnd, GWL_EXSTYLE)
lExStyle = lExStyle Or WS_EX_TRANSPARENT
Call SetWindowLong(fraThis.hwnd, GWL_EXSTYLE, lExStyle)
Call SetBkMode(GetDC(fraThis.hwnd), TRANSPARENT)
Call SetWindowPos(fraThis.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_FRAMECHANGED)
Call InvalidateRectLong(fraThis.hwnd, vbNull, True)
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar