Lively Controls on Form
We always concentrate on timely completion of a Project and to deliver it to the Users as quickly as possible. When I am pressurized to complete a particular project I will try to complete it as quickly as possible and deliver it to the User. But all the time I would like to have a second look at the overall design and appearance of the Forms and Reports in a relaxed atmosphere and bring in some improvements with whatever new tricks that I can think of at that point of time.
In my past experience on these kind of improvements I have been always rewarded with appreciation from the Users. Their responses on these little things that I have incorporated into the design always encouraged me to look for something different next time. Forms are the main component of any Application that catches the eye of the Customers besides nicely formatted Reports and impressive Graph Charts.
Forms have a special place in the minds of the User. It should be pleasing to look at and user friendly to work with. Once the initial pressure of designing the main components of an application is over and if you have enough time to have a second look at the main forms' design you can make use of your creative ideas and pull little tricks on the Form that will do wonders. All the controls we draw on the Microsoft Access Forms remains stationery for ever. If we can put some action of movement on some of the controls, without overdoing it, it will definitely have some positive impact on the Customers.
We have learned several animation tricks on controls in the past and If you would like to take a second look at then their links are given 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
Here, we will do a simple trick on an Option Group Control to respond, when the mouse moves over it for selection of options. The trick is simple, when the Option Group control is created we will give it a Raised Style design. When the mouse moves over the Option Group control the Style will change to Sunken. When the mouse moves away from the Option Group control it will go back to its earlier Raised state. Repetition of this action gives a lively look to the Option Group control.
- 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 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 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 same as the Option Group control and align it to 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
- 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.
- Open the Form in normal view. You will find the Option Group control is in Raised style.
- Move the mouse over the control and it will enter into Sunken state.
- Move the Mouse pointer away from the control and it will restore back to Raised state.
- Repeat this action in quick succession and you can see how the Option Group control responds to this simple action, otherwise the control remains rigid for ever.
Menus with Option Group Control