Tag: Forms

On the use of Tabs

Tabs are everywhere. The most common complaint is that they allow lazy UI design. It’s easy to see why that argument has come about, but tabs are undeniably useful, to break things up, or as a grouping control. For my money, here’s the 101.

Excel’s option dialog is awash with tabs, 13 all told. I’ve been using Excel for years, I still can’t remember where all the options are, I know there in there somewhere, but often times I’ll have to do a bit of hunting. Not clever!


MS Project is better, the tabs are all the same size which is an improvement, but still look at how many there are – 3 rows no less!

Firefox uses pictures, which I like, but its real win is that there’re only 7 tabs – on one line. Ok, so Firefox has fewer features than Excel or MSP. Still that’s not the point, the point is the number is manageable – having everything on one line is “Log2(N-1)”* times easier to consume than multiple line.

Best of all I like tabs down the side. I don’t think they work in all cases, but for something like options, down the side is good. Office 2007+ has swapped to this design in a lot of its dialogs. I don’t love its implementation, but the ideas good. Visual studio does it well. There are tabs across the top, so another “sub set” would be confusing, down the side makes sense. UI design should be about making sense! Also it’s really well done. Look how the selected tab stands out, and is associated to the content on the RHS.

So over all I would suggest,
1. Keep the number of tabs down, no more than 6
2. Only one row
3. Use images if you like
4. Use RHS tabs where you can – Sadly VBA’s tabs down the RHS are quite poor.

These are just my unqualified thoughts of course, you’re welcome to yours, and feel free to express them in the comments!

*1. I’m guessing, that is to say it’s my option that it’s easier, and 2; I’m postulating that the difficulty of finding the right tab follows something like Hick’s Law.

Pop up Style Forms in Excel

Final one in the blast from the past series, a pop up type form, you probably wouldn’t implement it like I’ve done in the example file but you get the idea!

popupform

The file can be found here: PopUpForm

Drawing on a VBA Userform

I’m making a few post with old stuff from my main site (which is now closed), this is so I can point to the blogpost when I update my downlaods page, which I am planing on doing at some stage in the next few years!

This example uses an API to let you actually draw on the form free hand style!

drawonform

It  can be downloaded here: Drawing_v3

Custom Form Shapes In VBA and Excel.

You can customise the shape of your user forms, and it’s Kewl! All the kids in my house are doing it! Look at this stupid form shape I was able to make!

CustomerShapForms.PNG

Why on earth would you want to do it I hear you ask?! That’s a very good question! When I started this I thought it was really not very useful at all. I’m still thinking that, but maybe there might be a few practical uses for it. I’m thinking tool tips and popup type things. I have covered using captionless user forms (and worksheets!), and even popup forms previously. I was never happy with the way the captionless forms looked in VBA, they look ok in VB6 but in VBA they has a wafty boarder.

Of course if you want to move over to VSTO you can even make a user form in the shape of John Walkenbach’s upper half! Is that the sound of ringing tills I can hear!

A John Shaped Form.PNG

MIE Custom Form Shapes.xls

Release.zip (Excel 2007 only + .Net 3/3.5)

List Box Resizing problems

Ran in to an old friend today, and it took me a while to remember what to do. After adding a list box to your user form, you’ll want to resize it so that it looks nice. At design time you can get all your controls lined up without too much effort. Like this:

DesignTime.JPG

However when the form is run, the list box automatically resizes itself! Like this!

RunTime.JPG

The answer is to change the a default setting, the “IntegralHeight”, and problem solved. The difference is that now your list box will show parts of lines that don’t fill the list box exactly, rather than resizing to accommodate only whole lines.

fixed.JPG