hello guys please can you help me with my problem in picturebox that can be able transparent during the form is load?
need help how to trasparent the picturebox?need help how to trasparent the picturebox?
Page 1 of 1
2 Replies - 3085 Views - Last Post: 31 January 2008 - 06:18 PM
Replies To: need help how to trasparent the picturebox?
#2
Re: need help how to trasparent the picturebox?
Posted 31 January 2008 - 12:39 PM
This may help, it may not...
This code can do the whole form:
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
This code can do the whole form:
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 Function MakeTransparent(OObject As Object, Perc As Integer) As Long Dim Msg As Long Msg = GetWindowLong(OObject.hWnd, GWL_EXSTYLE) Msg = Msg Or WS_EX_LAYERED SetWindowLong OObject.hWnd, GWL_EXSTYLE, Msg SetLayeredWindowAttributes OObject.hWnd, 0, Perc, LWA_ALPHA End Function Private Sub Command1_Click() Dim RReturn As Long ' MakeTransparent - object, percentage of transperency.. RReturn = MakeTransparent(Form1, 128) End Sub
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
#3
Re: need help how to trasparent the picturebox?
Posted 31 January 2008 - 06:18 PM
LookNAO, on 31 Jan, 2008 - 12:39 PM, said:
This may help, it may not...
This code can do the whole form:
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
This code can do the whole form:
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 Function MakeTransparent(OObject As Object, Perc As Integer) As Long Dim Msg As Long Msg = GetWindowLong(OObject.hWnd, GWL_EXSTYLE) Msg = Msg Or WS_EX_LAYERED SetWindowLong OObject.hWnd, GWL_EXSTYLE, Msg SetLayeredWindowAttributes OObject.hWnd, 0, Perc, LWA_ALPHA End Function Private Sub Command1_Click() Dim RReturn As Long ' MakeTransparent - object, percentage of transperency.. RReturn = MakeTransparent(Form1, 128) End Sub
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
LookNAO, on 31 Jan, 2008 - 12:39 PM, said:
This may help, it may not...
This code can do the whole form:
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
This code can do the whole form:
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 Function MakeTransparent(OObject As Object, Perc As Integer) As Long Dim Msg As Long Msg = GetWindowLong(OObject.hWnd, GWL_EXSTYLE) Msg = Msg Or WS_EX_LAYERED SetWindowLong OObject.hWnd, GWL_EXSTYLE, Msg SetLayeredWindowAttributes OObject.hWnd, 0, Perc, LWA_ALPHA End Function Private Sub Command1_Click() Dim RReturn As Long ' MakeTransparent - object, percentage of transperency.. RReturn = MakeTransparent(Form1, 128) End Sub
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
hello thank you for this code...but anyway i want a picturebox can trasparent into the forms.....again thank you sharing me with this...
LookNAO, on 31 Jan, 2008 - 12:39 PM, said:
This may help, it may not...
This code can do the whole form:
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
This code can do the whole form:
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 Function MakeTransparent(OObject As Object, Perc As Integer) As Long Dim Msg As Long Msg = GetWindowLong(OObject.hWnd, GWL_EXSTYLE) Msg = Msg Or WS_EX_LAYERED SetWindowLong OObject.hWnd, GWL_EXSTYLE, Msg SetLayeredWindowAttributes OObject.hWnd, 0, Perc, LWA_ALPHA End Function Private Sub Command1_Click() Dim RReturn As Long ' MakeTransparent - object, percentage of transperency.. RReturn = MakeTransparent(Form1, 128) End Sub
Now, if you want the picturebox invisible because there is something behind it that you want the user to see:
Picture1.visible = false
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|