Going along with the simple userform we’ve been working with throughout this article, there will be three VBA subroutines you will need to add to your Userform in order to make both buttons have a proper hover effect. Hopefully, that makes some sense and if not, definitely check out my more in-depth article. Consequently, when the user moves their mouse away from a button, the OnMouse VBA event can trigger the white button to reappear and hide the green button. You can use the OnMouse VBA event to determine when the user’s cursor is hovering over one of your white buttons and trigger the white button to be invisible (revealing the green button which will be the button the user actually clicks).
A green button will hide directly behind a white button. The general concept equates to you using Image Controls to toggle the two button images created in the prior section (green and white buttons).
ART VISIBLE BODY APP LOGIN CODE
I dedicated an entire article to explaining the concept of this effect so I won’t re-hash the contents of that post entirely, but if the following code doesn’t make sense, you should definitely consider reading my article entitled: Creating Userform Buttons That Highlight Mouse Hovering. Remember, you are going for a subtle effect and don’t want to overkill it with too many changes when you user is hovering over buttons. This effect has erased the need to change the cursor icon from the pointer to the pointing hand (in my opinion) and I HIGHLY RECOMMEND you only implement one or the other within your userforms. I think they are so simple and elegant but give the user the most subtle of clues of where one might want to click. I am an absolute sucker for hovering effects on buttons.
ART VISIBLE BODY APP LOGIN HOW TO
PRO TIP: If you do not know how to manually add a custom RGB color code, THIS ARTICLE will show you how. Though these changes may be subtle, they do just enough to bring the default sunken textbox appearance to a more current and familiar look.
To modernize these controls, you’ll want to tweak the below properties for them. TextBox controls allow users to enter information into them and are controls I see quite frequently while interacting with userforms.
Here are the key property changes you should make at the Userform level and therefore be applied to every control on your Userform where applicable.īorderColor: &H00A9A9A9& (Light Gray) Formatting TextBox Controls If you are performing a makeover to an existing Userform, you’re unfortunately going to have to apply these formats to all the controls individually (but make sure to select multiple controls by holding down your Ctrl key and “bulk change” the formats to save time. We can leverage these inter-workings to our benefit and knock out a large amount of the formatting needs. Properties that are shared between all controls (such as Font color and BackColor), default to whatever the Userform Object is currently set to prior to inserting a new control. It’s very important to keep in mind what your overarching formats will be when first building a Userform.