Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox Colors
Message
From
02/12/2008 08:48:40
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows '98
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003494
Message ID:
01365088
Views:
33
Ok, so I can't affect an already existing combo on a form. I have to define it in code? I just want to be able to take existing combos that are placed in the form designer on a form. I'm guessing that it can only be done through defining classes in code.

>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform