Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating custom spinner control buttons
Message
From
29/04/2008 10:07:21
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01313683
Message ID:
01313795
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi,
>>>
>>>I want to create a custom spinner control (without inheriting from the VFP spinner class). My question is to what captions or images to use on the two buttons to make them look just like VFP spinner control buttons.
>>>
>>>Thank you in advance for any suggestions.
>>
>>What's wrong with just using a spinner control? just add:
>>
>>
>>This.Width = Sysmetric(5) + 4
>>
>>
>>to the init event
>>
>>Carlos
>
>Brilliant idea! Thank you very much.
>By the way, why do you add 4 to the Sysmetric(5) for the width?

To account for the spinner borders, I got the 4 by trial and error and doing PrtScreen and pasting into a graphics program and zooming in and checking the results.

If you don't want the borders, do the following:

Add a container to the form, add a spinner inside the container, then:
*!* Container Init
This.Width = Sysmetric(5) - 2
This.Height = This.spinner1.Height - 6

*!* Spinner Init
This.Width = Sysmetric(5)
This.Height = Sysmetric(6) * 2 
This.Top = -3
This.Left = 1
And voila! an up/down control with no borders, and sized just like the scrollbars arrows.

Carlos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform