I am using vb6.
First I want to tell what I want and then ask my question.
I have a label in my form named label1.what I want that when the user get his mouse over the label the mouse icon changes and also the color of the label changes and when the user lost focus of the label the mouse icon comes back to arrow and the label also changes it color to black.
Question 1 . About Changing Colur
As I told I want to change the label color when the label get focus I am using the following codes
QUOTE
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Lable1.ForeColor = &HE2926B
End Sub
The color changes successfully but how can I detect that the user now lost focus over label so I can change color back to black. There are only two more mouse events that is mouse up and mouse down which work with click and there is no lost focus evnet so how I can change its color to black again.
Question 2 About changing mouse icon
In order to change mouse icon what I am doing is first selecting label and then from properties window changing mouse pointer to 99-custome and from properties window setting mouse icon to C:\Program Files\Microsoft Visual Studio\COMMON\Graphics\Cursors\H_Point.cur
This work fines but can we do it programmatically ,
I am using the following code instead of setting from properties window but getting error . I also put h_point cursor in my application path.
QUOTE
Private Sub Form_Load()
Lable1.MousePointer = 99 - custom
Label1.MouseIcon = App.Path & "\H_POINT"
End Sub
The error is type mismatch and point me to ‘&’ at line
QUOTE
Label1.MouseIcon = App.Path & "\H_POINT"
So what wrong in this code.i want to do it programatically now using properties window.
This post has been edited by muddasir: 1 Jan, 2009 - 04:05 AM