Results 1 to 7 of 7

Thread: highlighting

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    I would like to change the forecolor of a label when a user passes over it, and return it to the my old color when they get off it...is this possible?(i think ive seen this before is all)

    also anyone have an idea why the numbers 1-4 above the letters on my keyboard don't work?(i used numpad to show those incase you wondered)
    Ian Callanan
    VB6.0
    [email protected]

  2. #2
    Member
    Join Date
    Nov 1999
    Location
    Manila, Philippines
    Posts
    59
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    'SET DEFAULT FORECOLOR
    Label1.ForeColor = &H8000000F
    End Sub

    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    'SET DESIRED FORECOLOR
    Label1.ForeColor = H80000012&
    End Sub
    Mikey
    A/P
    Using VB6 SP4 Enterprise Ed.

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb SetSysColor API

    You can use the SetSysColor API to change all your Windows System Color.

    If you need the sample program that I've written to change all the system color, then just email me & I'll send it to you.

    Code:
    Option Explicit
    Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
    
    Const COLOR_INFOTEXT = 23
    Const COLOR_INFOBK = 24
    Private Sub Form_Load()
    'This will change the ToolTips background color to Blue Colour
    'and ToolTips text to Red Colour
    SetSysColors 1, COLOR_INFOTEXT, vbRed
    SetSysColors 1, COLOR_INFOBK, vbBlue
    End Sub

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    is there any kind of "mousemoveoff" sub?
    Ian Callanan
    VB6.0
    [email protected]

  5. #5
    Guest
    I don't think there is..but put the change the labels color by putting the code in form_move or any command you want.

  6. #6
    Guest
    This code checks if the Mouse is on the Control or not.

    Code:
    If X < MyControl.Left Or X > MyControl.Width Or Y < MyControl.Top Or Y > MyControl.Height Then...

  7. #7
    Guest
    have a look at 'SetCapture' and 'ReleaseCapture' API calls at http://www.vbapi.com. using these functions you could easily implemet MouseEnter and MouseExit events.

    best regards

    Sascha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width