Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating custom spinner control buttons
Message
De
29/04/2008 10:07:21
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01313683
Message ID:
01313795
Vues:
10
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform