Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox Colors
Message
 
À
02/12/2008 07:33:02
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows '98
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01003494
Message ID:
01365084
Vues:
28
>How would this be done in the Form Designer with an existing ComboBox? I know this message is old, but it seems to address what I need, except I'm not working in a PRG for this.
See if this help
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

**************************************************
*-- ParentClass:  form
*-- BaseClass:    form
*
DEFINE CLASS form1 AS form

    DoCreate = .T.
    Caption = "Form1"
    Name = "form1"

    ADD OBJECT combo1 AS combobox WITH ;
        Height = 31, ;
        Left = 34, ;
        Top = 25, ;
        Width = 276, ;
        Name = "Combo1"

    PROCEDURE Init
        CREATE CURSOR crsTest (Id I, FirstName C(20))
        INSERT INTO crsTest VALUES(2,[Vlado])
        INSERT INTO crsTest VALUES(3,[Tom])
        INSERT INTO crsTest VALUES(5,[Jordan])
        INSERT INTO crsTest VALUES(6,[Tito])

        DEFINE POPUP pList

        iii = 0
        SCAN
            iii = m.iii + 1
            lcColor = IIF(MOD(crsTest.ID,2) = 0, "RGB(255,255,255,192,0,0)","RGB(255,255,255,192,255,0)")
            DEFINE BAR m.iii OF pList PROMPT crsTest.FirstName FONT "Tahoma",14 style "BI" COLOR , &lcColor
        ENDSCAN

        WITH ThisForm.Combo1 AS ComboBox
             .RowSourceType = 9
             .RowSource     = "pList"
             .Style = 2
        ENDWITH     
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
>
>>
>>IF PEMSTATUS(_Screen, 'cboTest', 5)
>>    _Screen.RemoveObject('cboTest')
>>ENDIF
>>condition = 1
>>DEFINE POPUP popTest
>>
>>m.test = IIF(condition=1,'RGB(0,0,0,255,0,0)','RGB(0,0,0,46,56,3)')
>>DEFINE BAR 1 OF popTest PROMPT 'Red' COLOR ,&test
>>DEFINE BAR 2 OF popTest PROMPT 'Blue' COLOR ,RGB(0,0,0,0,0,255)
>>DEFINE BAR 3 OF popTest PROMPT 'Green' COLOR ,RGB(0,0,0,0,255,0)
>>DEFINE BAR 4 OF popTest PROMPT 'Yellow' COLOR ,RGB(0,0,0,255,255,0)
>>
>>_Screen.AddObject('cboTest', 'ComboBox')
>>
>>WITH _Screen.cboTest
>>    .Top = 200
>>    .Left = 50
>>    .RowSourceType = 9
>>    .RowSource = 'popTest'
>>    .Visible = .t.
>>    .style = 2
>>    .value = 3
>>ENDWITH
>>
>>Try the same code with
>>
condition = 2
>>
>>HTH
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform