+ Reply to Thread
Results 1 to 4 of 4

How to change the backColor of a UserForm control when/after it is clicked / updated

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    Paris, France
    MS-Off Ver
    10
    Posts
    2

    How to change the backColor of a UserForm control when/after it is clicked / updated

    Hi there

    In my current project, I guide users of my userform through a process. To make it extra intuitive, I highlight the control that they need to interact with at a given step.
    As soon as they've made their selection on a control, the idea is to un-highlight that control and highlight the next one.

    This mostly works, but not always.
    I am having a particularly hard time with a multiLine LisBox, which is the final control that the user needs to interact with.

    It seems that the control's properties, such as .backColor are soft-locked during events that are triggered by the control itself.
    I had hoped to get around this by using the afterUpdate or the Exit events, but I find that even if the code that attempts to set the white (not highlighted) backColor is actually called, the color is not changed.

    I've also tried using the Change, MouseUp and Click events, but nothing seems to work.
    Help would be much appreciated!

    Best regards
    Pieka

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: How to change the backColor of a UserForm control when/after it is clicked / updated

    User the Enter event. This fires when the ListBox gains focus. Make sure that the list box does not have focus on UserForm activation.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-15-2018
    Location
    Paris, France
    MS-Off Ver
    10
    Posts
    2

    Re: How to change the backColor of a UserForm control when/after it is clicked / updated

    Thanks Jeff, but I get the same problem here as I do with the _change event.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to change the backColor of a UserForm control when/after it is clicked / updated

    hmmm

    small scale experiment
    ..i used a loop to clear things out
    in case you click out of sequence (i guess?)
    Attached Files Attached Files
    Last edited by humdingaling; 10-18-2018 at 02:42 AM. Reason: typo
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change Control Backcolor Based on Conditional Formatted Cell Color
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2018, 01:23 PM
  2. When does Worksheet ControlSource for UserForm Control Get Updated?
    By phillfri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2017, 09:26 PM
  3. [SOLVED] Macro to permently change backcolor on a userform
    By aworfolk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2015, 06:10 PM
  4. [SOLVED] change range a table appears every time a button within a userform is clicked
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 05:07 PM
  5. [SOLVED] UserForm Command Button - how to make it change appearance when clicked
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2012, 10:53 AM
  6. Replies: 0
    Last Post: 05-03-2007, 10:51 AM
  7. [SOLVED] Problem: Control Toolbox Control resizes when clicked
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2005, 03:05 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