Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spinner updating while spinning
Message
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:
01238647
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 :-))

May be it's a problem in VFP8 version I'm using, but I can not change the number by typing it in the text portion. It only allows me to type one digit instead of the number.

Hmmm, with your code it works (you removed thisform.refresh() as I see). Though if I type 2333 it gives me an error. Why Keyboard max/min values are ignored?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform