+ Reply to Thread
Results 1 to 3 of 3

Change TextBox Border Color

  1. #1
    Registered User
    Join Date
    11-09-2016
    Location
    London, England
    MS-Off Ver
    2010/2016
    Posts
    72

    Change TextBox Border Color

    Hi,

    In my form I am changing the border color of textboxes based on their validation state: green = good, red = error.

    The process of setting this is done within a function: I'm looping through all texboxes passing the control to a function, checking the value within the function and setting things appropriately.

    In my others forms, this all happens when pressing an OK button and seems to work alright (I'm assuming because pressing ENTER give focus to the OK button). However, in another form I'm working on I am checking the value after each key press (TextBox_Change event). Doing it this way, the border does not change (whether valid or not) until I click any other control on the form to take focus away from the text box.

    Can I change this behaviour?

    Thanks

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Change TextBox Border Color

    try adding a Me.Repaint after you change border colour
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-09-2016
    Location
    London, England
    MS-Off Ver
    2010/2016
    Posts
    72

    Re: Change TextBox Border Color

    Perfect, thanks!

+ 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. Outside border change color
    By DanS52 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-14-2017, 12:55 PM
  2. [SOLVED] Click oval option button to fill/unfill color, also change border color to match fill
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2015, 08:29 PM
  3. Replies: 1
    Last Post: 11-24-2012, 12:38 PM
  4. [SOLVED] Border color doesn't change.
    By Rusty in forum Excel General
    Replies: 3
    Last Post: 03-10-2006, 01:45 AM
  5. how to change form border color?
    By dpenny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 09:44 PM
  6. Change the border color used by Change Tracking
    By Jim Stoaks in forum Excel General
    Replies: 1
    Last Post: 01-20-2006, 05:40 PM
  7. Replies: 3
    Last Post: 11-02-2005, 07:55 PM

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