Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spinner updating while spinning
Message
 
À
09/07/2007 11:25:17
Scott Sherman
Puyallup Tribal Health Authority
Tacoma, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01238626
Message ID:
01238644
Vues:
9
>I want to have the background color to be updated each time the spinner value is changed. If I put the below code in InteractiveChange, the value of the spinner gets trapped. If I put the code in Valid, it only changes when enter or tab is pushed. There has to be a trick to get this to work. Can someone tell me what it is?
>
>Please and thank you,
>
>THISFORM.BACKCOLOR = RGB(THIS.PARENT.SpnBackRed.VALUE,THIS.PARENT.SpnBackGreen.VALUE,THIS.PARENT.SpnBackBlue.VALUE)
>THISFORM.REFRESH()
>
>Scott Sherman

This works for me:
oForm = CREATEOBJECT([Form1])
oForm.Show(1)

**************************************************
*-- Form:         form1 (d:\works\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/09/07 07:08:04 PM
*
DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 98
    Width = 240
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"


    ADD OBJECT spnred AS spinner WITH ;
        Height = 24, ;
        KeyboardHighValue = 255, ;
        KeyboardLowValue = 0, ;
        Left = 116, ;
        SpinnerHighValue = 255.00, ;
        SpinnerLowValue =   0.00, ;
        Top = 9, ;
        Width = 120, ;
        Name = "spnRed"


    ADD OBJECT spngreen AS spinner WITH ;
        Height = 24, ;
        KeyboardHighValue = 255, ;
        KeyboardLowValue = 0, ;
        Left = 116, ;
        SpinnerHighValue = 255.00, ;
        SpinnerLowValue =   0.00, ;
        Top = 37, ;
        Width = 120, ;
        Name = "spnGreen"


    ADD OBJECT spnblue AS spinner WITH ;
        Height = 24, ;
        KeyboardHighValue = 255, ;
        KeyboardLowValue = 0, ;
        Left = 116, ;
        SpinnerHighValue = 255.00, ;
        SpinnerLowValue =   0.00, ;
        Top = 61, ;
        Width = 120, ;
        Name = "spnBlue"


    ADD OBJECT label1 AS label WITH ;
        Caption = "Red", ;
        Height = 17, ;
        Left = 62, ;
        Top = 13, ;
        Width = 40, ;
        Name = "Label1"


    ADD OBJECT label2 AS label WITH ;
        Caption = "Green", ;
        Height = 17, ;
        Left = 62, ;
        Top = 43, ;
        Width = 40, ;
        Name = "Label2"


    ADD OBJECT label3 AS label WITH ;
        Caption = "Blue", ;
        Height = 17, ;
        Left = 62, ;
        Top = 66, ;
        Width = 40, ;
        Name = "Label3"


    PROCEDURE spnred.InteractiveChange
        thisform.BackColor  = RGB(this.Value, thisform.spnGreen.Value, thisform.spnBlue.Value)
    ENDPROC


    PROCEDURE spngreen.InteractiveChange
        thisform.BackColor  = RGB(thisform.spnRed.Value, this.Value, thisform.spnBlue.Value)
    ENDPROC


    PROCEDURE spnblue.InteractiveChange
        thisform.BackColor  = RGB(thisform.spnRed.Value, thisform.spnGreen.Value, this.Value)
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
(error handling and test for invalid values are not included :-))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform