You read your combo box in the combo box click event. Each scroll
incrament fires the click event. So that is where you capture the
value and update your variable if required.
iSize = CInt(Combo1)
Combo boxes have a default Text property value just like Text boxes.
You don't need to explicitily refrence the .Text Property.
Combo1 is equivalent to Combo1.Text
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