The yellow objects on my form show the transparency of the click-through
I have a problem with yellow objects being "clicked" on multiple vb6 forms in my application:
The only thing I can think of that might affect this is the following (from VBForums , which I used to make the blue elements transparent, as you can see in the image, however this shouldn't affect vbYellow.
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 Declare Function SetLayeredWindowAttributes Lib "user32" ( _
ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Sub Form_Load()
Me.BackColor = vbCyan
SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, vbCyan, 0&, LWA_COLORKEY
End Sub
I tried to replace the vbYellow form with an image of the same color. This will also have the plus of a Click function, but ends up with the same result without even triggering any Click Click function.
+3
source to share
No one has answered this question yet
See similar questions:
or similar: