Introduction
In most projects, our primary focus is always on completing the work on time and delivering it to the user as quickly as possible. I make every effort to stay on schedule and ensure that the user receives the application for testing without delay. However, I also like to take a second look at the overall design and appearance of the Forms and Reports in a more relaxed frame of mind. This allows me to introduce some improvements, explore new ideas, and incorporate enhancements—alongside the requirements suggested by the user.
From past experience, these little refinements have always been met with appreciation. Users often respond positively to subtle design improvements, which motivates me to keep experimenting with fresh ideas in future projects. After all, Forms are the first component that catches a user’s eye, followed by well-formatted Reports and visually engaging charts.
Forms hold a special place in the Users' minds. They should not only be functional but also visually pleasing and user-friendly. Once the core functionality of an application is complete, and if time permits, revisiting the main forms’ design can open the door for creativity. Even small visual tricks can make a significant difference. For instance, most controls we place on Microsoft Access forms are static, but by introducing a touch of movement or animation—applied tastefully and without excess—we can leave a lasting positive impression on users.
We have already explored several animation techniques for form controls in earlier discussions. If you’d like to revisit those, the links are provided below:
- Command Button Animation
- Reminder Ticker Form
- Startup Screen Design
- Animated Floating Calendar
- Wave Shaped Reminder Ticker
- Command Button Animation-2
- Animating Label on Search Success
- Run Slide Show when Form is Idle
- Label Animation Style-1
- Label Animation Style-2
- Label Animation Variant
- Label Animation Zoom in Style
- Label Animation in Colors
- Label Animation Zoom-out Fade
- Digital Clock on Main Switchboard
Option Group Control Style Change on Mouse Move.
In this example, we will apply a simple trick to an Option Group control to make it respond visually when the mouse moves over it. The idea is straightforward: when the Option Group is created, we set its Style property to Raised. As the mouse moves over the control, the style changes to Sunken, and when the mouse moves away, it reverts back to the original Raised state. This repeated action gives the Option Group a more dynamic and lively appearance, making the form more engaging for users.
Create a Form for Demo.
Open a new Form in Design View.
Click on the Wizard Button (with the magic wand icon) on the Toolbox to select it, if it is not already in the selected state.
Select the Option Group control and draw it on the detail section of the form.
Enter the options as shown on the design below by pressing the Tab key after each option to advance to the next row. You may enter any Text as options as you like.
Complete the design by selecting the Finish Command Button.
Move the attached label above and make it as wide as the Option Group Control, and change its Caption to Main Menu.
Move the attached child label above and make its width the same as the Option Group control, and align it to the left edge.
Change the Caption of the label to Main Menu.
Click on the Option Group to select it and display its Property Sheet (View -> Properties or press ALT+Enter).
Change the following Property Values as given below:
Name = Frame0
- Back Style = Normal
- Special Effect = Raised
The Form's Class Module Code.
Display the VBA Code Module of the Form (View ->Code or click on the Module Toolbar Button or press ALT+F11).
Copy and Paste the following VBA Code into the VBA Module of the Form:
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) If Me.Frame0.SpecialEffect <> 1 Then Me.Frame0.SpecialEffect = 1 End If End Sub Private Sub Frame0_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) If Me.Frame0.SpecialEffect <> 2 Then Me.Frame0.SpecialEffect = 2 End If End Sub
Save and close the Form.
The Demo Run.
Open the Form in the normal view. You will find the Option Group control is in Raised style.
Move the mouse over the control, and it will enter the Sunken state.
Move the mouse pointer away from the control, and it will restore to the Raised state.
Repeat this action in quick succession, and you can see how the Option Group control responds to this simple action; otherwise, it remains rigid forever.
No comments:
Post a Comment
Comments subject to moderation before publishing.