12 February 2007 by Ross McLean
This will be the first of three posts I’ll make on “interacting with users”, or more specifically message and error boxes! Here’s the outline:
1. The current state of play
2. There’s a problem?… If it aint broke?
3. Suggestions for Improvements
So let’s get started then!

Shocking really! Ok so that’s a bit of fun but it does go some way to show just how little windows messaging has changed. To emphasise the point take a look at the images below which are message boxes from different versions of windows
Windows 3.x

Windows 95

Windows NT

Windows XP

Windows Vista

For a while now I’ve had the feeling that message boxes, input boxes and error messages are just “broken”. Modern software such as Visual Studio has made some improvements in this type of messaging with extended descriptions of errors and suggestions for fixes but there are still short comings.
One of the problems a platform like Windows faces is that it has to support the design of all message box code from it’s APIs. Code that calls this API is limited to the original design of the API. Excel is an example of a programme that does this.
And so to the specific case of Excel. Right out of the box there are issues with the message box function, mainly its modal nature. This can be over come by using the Windows API directly yourself, as described here.
But this isn’t at the core of the broken-ness and we will take a look at these in my next post!
Tags: Best Practice, Examples, UI, VBA
Categories: UI Design •
2 Comments »
12 February 2006 by Ross McLean
UPDATE:
Check Out Andy Popes code, a much better method of moving a userform with out a caption:
Here is some code to move the form around without the need for API coding.
Create a couple of private variables in the userform to remember the position when the left mouse button is pressed.
[vba]
Private m_sngX as single
Private m_sngY as singlePrivate Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
m_sngX = X
m_sngY = Y
End If
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
Me.Left = X + Me.Left – m_sngX
Me.Top = Y + Me.Top – m_sngY
End If
End Sub [/vba]
Orginal post
Yesterday I was playing around with Jan Karel Pieterse Watch Other Cell tool. I wanted to make the user form captionless and transparent. That’s easy enough to do but a problem arose. With the caption removed the form could not be moved.
One work around was to use the forms mouse move event and an API Call to hook the cursor location. Another API call is made to reposition the form. The Down and Up events are used to “turn on” weather or not we what to move the form. For the user it is much the same as a normal move process.
The API routines are included in the example file attached. If your thinking, “why not just use mouse X, Y and top and left?”, it’s because the API’s returns cursor position and will place the form with in your systems co-ordinate structure, not just excels. The results are more reliable.
There is one problem still outstanding with this method. When you first click the form to reposition it the form “jumps” to the places where you clicked the mouse. If it’s near the top left corner, then the result is hardly noticeable, it’s a different story down in the right hand corner. I think code could be written to correct for this but maybe you could simply put in an icon near the top left to allow the move?
Enjoy!
Moveable Captionless Userform
Tags: Examples, Forms, UI, VBA
Categories: Downloads, UI Design •
3 Comments »
22 January 2006 by Ross McLean
Big Dick Kusleika over at Daily Does of Excel made some suggestions for Excel 12. One of which was to have captionless worksheets.
The following example sort of does it, it’s a modification of Steven Bullen’s and Tim Clem’s Form fun class.
I didn’t spend very long on this as it’s not really of any use to me, I just wondered if it could be done. To use it in anger you’d have to tightly control the windows index and there protection settings I’d guess. And what about adding transparency?
DOWNLOAD .XLS
Tags: API's, Downloads, Examples, Forms, VBA
Categories: Code, General, UI Design •
4 Comments »
15 January 2006 by Ross McLean
Following a question over at JMT forums, I have literally thrown together some examples of methods for displaying “in-line” help.
By “in-line” I mean the sort of help that’s displayed right next to the area where it’s needed/used. I don’t believe any of these methods should form the base for a well structured help system, and some boarder on the silly. Still, there is clearly a place for such in-line help.
The original question made reference to the “chunkiness” of user forms. I personally quite like that chunkiness. Always keep in mind that it’s the quality of what’s said not only how it is presented!. Be very clear. List each and every step required. Be concise.
Enjoy! – Example WorkBook
Tags: Downloads, Examples, Forms, VBA
Categories: Code, UI Design •
No Comments »