Today, the second article of my series on the development of the additional tool for Excel Soccer World Cup 2010 Planner. Those who deal with Excel VBA, are certainly aware that own forms or UserForms can be created and be filled with controls. The design of the controls and the UserForm lies on older Windows versions and is – in my opinion – by its appearance a little bit boring. Below is a screenshot of the same UserForm, on the left side you can see the default design and on the right side an alternative variant.
Basically, it is of course not wrong to use the controls in the way shown on left side of the screenshot. However, I personally prefer brighter backgrounds and meaningful symbols as a button replacement. Let’s have a look to the UserForm as it will display in the tool. The example shows the controls for the options for the application settings. PS: the image also allows us a glimpse to the later features.
These controls are placed on a page of a MultiPage control. Unfortunately it is not possible to setup a background color at design time. So, I created a label, setted up the background color to white and placed it to the background. Then, I created and positioned the other labels, the texboxes and the comboboxes.
In a next step, I changed the following properties for the controls:
- SpecialEffect was changed to fmSpecialEffectFlat instead of fmSpecialEffectSunken.
- BorderStyle was changed to fmBorderStyleSingle instead of fmBorderStyleNone.
- BorderColor was changed to a user defined color.
- BackStyle was setted to fmBackStyleTransparent.
So, we have this state, as you can see in the screenshot below:
Look quite a bit better. Then, I had to insert some image controls for using icons in the UserForm. Fortunately, I have a sufficiently large library of icons in PNG format stored on my hard drive and they can be easily resized to a smaller size and stored in the bitmap format. As mentionned in the last post concerning the Excel Soccer World Cup 2010 Planner, you can find may icons on the website www.iconfinder.net, where most of the icons and symbols are free. I also inserted the hidden textboxes for the tooltips on my UserForm.
The image above also shows to icons for saving the changes and getting back to the main page. The grayed icons below are used in case the feature is disabled; the code just hides and unhides them.
So, the design of the settings page is completed now I can start to code. The other pages, for example for the export and import features, will be created in the same manner.
In the next article I will report about the development of ab own MsgBox feature for the planner addon, as the built in MsgBoxes are also gray and do not really fit into the design here.