Wow, I see the VIEW total but where is all the Replies :-)
I see all the VIEWS for this post but yet there is a lack of Replies. I bet you all are hard at work right now in intense search for the cure.
This is in VB6 Pro Ed. It'll probably work on yours
You'll have to account for the SrcInvert when you make your own pictures.
Put three pictures on a form (I don't give a toss about naming conventions). This is my way of telling you how to set the properties more quickly than explaining them to you individually:
Code:
'Picture1 is the Display Picture
With Picture1
.Picture = (None)
End With
'Picture2 is the MouseNotOver Picture
With Picture2
.ScaleMode = 3
.AutoRedraw = True
.Visible = False
.Picture = (Your MouseNotOver Picture)
.BorderStyle = 0
.Appearance = 0
End With
'Picture3 is the MouseOver Picture
With Picture3
.ScaleMode = 3
.AutoRedraw = True
.Visible = False
.Picture = (Your MouseOver Picture)
.BorderStyle = 0
.Appearance = 0
End With
And now for the real code:
Code:
'In Module:
Public PicNorm As Boolean
'In General Declarations:
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
'In Form Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static OpBef
If OpBef = False Then
BitBlt Picture1.hDC, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture2.hDC, 0, 0, vbSrcInvert
OpBef = True
Exit Sub
End If
If PicNorm = False Then
BitBlt Picture1.hDC, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture3.hDC, 0, 0, vbSrcInvert
BitBlt Picture1.hDC, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture2.hDC, 0, 0, vbSrcInvert
PicNorm = True
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If PicNorm = True Then
BitBlt Picture1.hDC, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture2.hDC, 0, 0, vbSrcInvert
BitBlt Picture1.hDC, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture3.hDC, 0, 0, vbSrcInvert
PicNorm = False
End If
End Sub
I don't know if this is what you wanted, but it sure doesn't flicker! (On my computer, anyway)
See ya!
I am not sure if this will help you out or not...
Hope you can get something from this to help you out.
Option Explicit
Dim highlighted As Boolean
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
' Highlight the control.
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If highlighted Then Exit Sub
highlighted = True
Label1.ForeColor = vbRed
Timer1.Enabled = True
End Sub
' See if we should unhighlight the control.
Private Sub Timer1_Timer()
Dim pt As POINTAPI
' See where the cursor is.
GetCursorPos pt
' Translate into window coordinates.
ScreenToClient hwnd, pt
' See if we're still within the control.
If pt.x < Label1.Left Or pt.y < Label1.Top Or _
pt.x > Label1.Left + Label1.Width Or _
pt.y > Label1.Top + Label1.Height _
Then
highlighted = False
Label1.ForeColor = vbBlack
Timer1.Enabled = False
End If
End Sub
Let me know if it helped.