No problamatico, (I get a kick out of Gringo_Problamatico's handle)
Notice if you try my trick, that you need to populate the box in a
bracket sense and then pin it in the middle. That way wheel roll up
or wheel roll down works. The Exit For is there in case the user
tries to roll into negative territory, or if he gives it focus when
the value is 1. Dont need to populate the box with values less then
0.
Notice too that in my case I decrament the list. Nothing says one
cant incrament the list. It all depends on what direction you prefer
your mouse roll event to have. If pulling back on the wheel feels
like you should roll down, then decrament, and vice versa otherwise.
Scott
--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote:
Awesome thanks so much Scott
----- Original Message -----
From: scott whitney
To: twsapi@y...
Sent: Saturday, July 13, 2002 8:14 AM
Subject: Re: twsapi: Spin buttons?
Spin buttons (Up Down Control) can be found in the components
directory as part of Windows Common Controls 2 (SP 4) group.
Very handy little critters....
I have found something I like even more. If the Text Box is
adjacent to another control, and you can mask the drop down button of
a combo box, here is a neat trick.
You empty the combo list and repopulate it with a suitable range,
where as your original value is the middle of the range. You do this
on the GotFocus event. After loading the list, you need to loop the
list and compare the list items with the original value in the box,
and when they match, set the .SelectedItem = the counter. This gives
full focus on the combo, making it ready for a mouse roll event.
Here is the code I use to stuff the box on GotFocus
For dblTemp = dblSnag + (20 * tickStep) To dblSnag - (20 *
tickStep) Step (-1 * tickStep)
cmbPoints(Index).AddItem Format(dblTemp, "0.00")
If dblTemp = 0 Then Exit For
Next dblTemp
Here is the code I use to loop the box and pin the list:
snag = cmbPoints(Index)
With cmbPoints(Index)
For iTemp = 0 To .ListCount - 1
If .List(iTemp) = snag Then
.ListIndex = iTemp
Exit For
End If
Next iTemp
End With
The user doesnt know its a combo box, but he can use it as a text
box, and he can also scroll the UpDown with his mouse wheel!
Image
Very kewl. Take a look at the attached image, and what appear to
be three labels. The left control is a Label. The middle control is a
type 0 combo box. The right control is a type 1 combo box. The right
hand combo masks the drop down button. You need a hvy weight control
to mask another heavy weight control. Just need to get your Zorder
right.
In my case the user can give focus to the center box, and roll
the mouse wheel...
I find it far more intuitive and quicker than heck.
Scott
Yahoo! Groups Sponsor
Click here to find your contact lenses!
To unsubscribe from this group, send an email to:
twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
--------------------------------------------------------------------
----------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes