Results 1 to 4 of 4

Mouse over event NOT re-triggering once item has been selected

Threaded View

  1. #1
    Registered User
    Join Date
    04-17-2020
    Location
    England
    MS-Off Ver
    2016
    Posts
    13

    Unhappy Mouse over event NOT re-triggering once item has been selected

    I have been struggling on this one for a few days now and can not seem to work it out. I am using images as buttons, which have a mouseover effect that changes the border to GREEN when the mouse is hovered over them, apart from the problem listed below and them flashing on hover, they work fine. see below for problem.

    I then have an onClick event which changes the border to GREEN if that image/button is selected, this indicates that this is active as the click opens a multi page, this bit also seems to work fine as I had to put in a repaint event in as it would not work without it. UserForm1.Repaint.

    The Problem I am having

    Once a image/button has been selected and then de-selected the mouse over event NO longer works on the image/button that was previously selected.

    Example, If I scroll the mouse over the two buttons below, their borders will change to green on hover, If I selected the WebBrowser button, its border will change to green, indicating that it is active. Once de-selected the mouse over will NO longer work on it. The de-selecting is done by selecting another button.

    This is my mouse over code
    Private Sub WebBrowserNewButt_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    ''Set WebBrowserNewButt Border Colour Green
    If WebBrowserNewButt.BorderColor <> 8435998 Then
       Me.WebBrowserNewButt.BorderColor = 8435998
    
        ''Grey Borders
        Me.MainMenuButton.BorderColor = -2147483627
        Me.SecondMenuButton.BorderColor = -2147483627
        Me.EmailButton.BorderColor = -2147483627
        Me.SearchButton.BorderColor = -2147483627
        Me.SaveNewButton.BorderColor = -2147483627
    End If
    End Sub
    Onclick code
    Private Sub WebBrowserNewButt_click()
    Me.WebBrowserNewButt.BorderColor = 8435998 'GREEN BORDER
    
    'GREY BORDERS, for all other images(buttons)
        Me.MainMenuButton.BorderColor = -2147483627
        Me.SecondMenuButton.BorderColor = -2147483627
        Me.EmailButton.BorderColor = -2147483627
        Me.SearchButton.BorderColor = -2147483627
        Me.SaveNewButton.BorderColor = -2147483627
        UserForm1.Repaint
    
    'MULTIPAGES
    Me.MultiPage1.Pages(0).Visible = True 
        MultiPage1.Value = 0
    
    Me.MultiPage1.Pages(1).Visible = False 
    Me.MultiPage1.Pages(2).Visible = False 
    Me.MultiPage1.Pages(3).Visible = False 
    Me.MultiPage1.Pages(4).Visible = False 
    End Sub
    What I have tried so far.
    • I have tried it with and without the Me. (I left it on Me.)
    • I have tried to google the answer
    • I have tried it without repaint, did not work without repaint, repaint does cause the images to flash.
    • I have tried to place the change boarder colour in the multi-page, so when active that multi page is visible = true then the image border colour will
      change, could not get it to work.
    • I removed the option of turning the borders to Grey on hover, that did not fix the problem.

    The multi-pages will not have their tabs set to visible.

    The only way I can get it to work is via Repaint, how this cause other objects on the userform to flash. on my userform. If someone know how to stop the flashing on repaint, then i would be happy with that as a fix. I tried to google the answer but everything I found was on Application. ScreenUpdating, which was no good

    Please could someone advise on what to do.
    INFO ONLY - I have also posted this on Stackoverflow, however as I am new to this forum I am restricted on posting links yet so can not post a link to that post. I have therefore copied that post over here. I got no replys on that post on StackOverflow. I therefore decided to post here as this is a more dedicated Excel and VBA forum.

    ERROR MESSAGE FOR POSTING A LINK (You are not allowed to post any kinds of links, images or videos until you post a few times.)

    As always thanks in advance.
    Last edited by Sharid; 04-18-2020 at 05:42 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete selected item from ListBox with KeyDown event
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2020, 03:57 AM
  2. Triggering an event in a csv file
    By mediaeval in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-06-2017, 12:01 PM
  3. Need Help with Event Triggering when value changes
    By calvinloo in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-12-2015, 03:54 AM
  4. EVENT triggering?
    By EXLent in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-19-2014, 07:16 AM
  5. Event triggering
    By Sarimdesert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2014, 03:26 AM
  6. VBA Event triggering
    By teachMeExcel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 02:12 PM
  7. Creating Selected Item Changed Event for ListView
    By Kyle123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2011, 09:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1