Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Hot Tracking' labels
Message
From
25/04/2001 07:41:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00499478
Message ID:
00499479
Views:
20
This message has been marked as the solution to the initial question of the thread.
>I'm trying to create a label control that changes it's colour when the mouse moves over it, and then changes colour back again when the mouse moves off it, like a hyperlink. My current method uses the MouseOver event to 'highlight' the label, but then I have to use the MouseOver event of the parent form to 'unhighlight' it again. I've also had to add the unhighlight code to the mousemove of any nearby objects as a swift mouse movement can 'jump' over the intervening space!
>
>Surely there must be a neater way?
>
>Justin.
>
>
>"How does the snow-plough driver get to work on a snowy morning?"

Justin,
Create a container class. You'd change the code to have the effect you want (I did this for a coolbutton) It uses OnMouseOut from files section :
Define CLASS coolbutton AS container
  Width = 249
  Height = 31
  BackStyle = 0
  BorderWidth = 0
  MousePointer = 99
  MouseIcon = "bitmaps\hand1.cur"
  Name = "launcherbutton"

*-- On mouse out effects
  Procedure onmouseout
  With this
    .BorderWidth = 0
    .SpecialEffect = 2 && Flat - default
    .Visible = .Visible
  Endwith
Endproc

  Procedure Init
  If !(type('thisform.IsMouseOut') = 'O' and !isnull(thisform.IsMouseOut))
    Thisform.NewObject('IsMouseOut','IsMouseOut',this.ClassLibrary)
  Endif
Endproc

  Procedure MouseMove
  Lparameters nButton, nShift, nXCoord, nYCoord
  With this
    .BorderWidth = 1
    .SpecialEffect = 0 && Raised
    .Visible = .Visible
  Endwith
  Thisform.IsMouseOut.CheckForMe(this)
Endproc

  Procedure MouseUp
  Lparameters nButton, nShift, nXCoord, nYCoord
  With this
    .BorderWidth = 1
    .SpecialEffect = 0 && Raised
    .Visible = .Visible
  Endwith
Endproc

  Procedure MouseDown
  Lparameters nButton, nShift, nXCoord, nYCoord
  With this
    .BorderWidth = 1
    .SpecialEffect = 1 && Sunken
    .Visible = .Visible
  Endwith
Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform