Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB Expert!

Join 244,295 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 898 people online right now. Registration is fast and FREE... Join Now!




Correct and Help in vb6 code

 
Reply to this topicStart new topic

Correct and Help in vb6 code

muddasir
31 Dec, 2008 - 08:26 AM
Post #1

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 108



Thanked: 7 times
Dream Kudos: 200
My Contributions
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

User is offlineProfile CardPM
+Quote Post


reyben_89
RE: Correct And Help In Vb6 Code
2 Jan, 2009 - 08:05 AM
Post #2

D.I.C Head
**

Joined: 30 Nov, 2008
Posts: 54



Thanked: 2 times
My Contributions
about in label color use mouseout event in set the color back to black. ok
in question no 2 i can't figure out the problem but i think may be in the path where i get the icon. better check it first if the icon you want to use is existed.
but i suggext that cahnge the mouse icon on the properties window of the label1
User is offlineProfile CardPM
+Quote Post

muddasir
RE: Correct And Help In Vb6 Code
2 Jan, 2009 - 08:13 AM
Post #3

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 108



Thanked: 7 times
Dream Kudos: 200
My Contributions
i got the answer i am missing loadpicture in the code the right code was

Label1.MouseIcon = loadpicture(App.Path & "\H_POINT")

Thanks
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 04:28PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month