Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop down list, have to click twice to see list values
Message
 
To
27/10/2006 08:16:12
Irv Adams
MSC Managed Care, Inc.
Florida, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01163890
Message ID:
01165064
Views:
14
Irv, here a simple form. Just change values of first Combo:
oForm = CREATEOBJECT([Form1])
oForm.Show(1)


**************************************************
*-- Form:            form1 (d:\all_zapl\test.scx)
*-- ParentClass:     form
*-- BaseClass:       form
*-- Time Stamp:      10/27/06 06:41:12 PM
*
DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 79
    Width = 237
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"


    ADD OBJECT combo1 AS combobox WITH ;
        BoundColumn = 2, ;
        ColumnCount = 2, ;
        ColumnWidths = "100,50", ;
        Height = 24, ;
        Left = 17, ;
        Style = 2, ;
        Top = 12, ;
        Width = 208, ;
        BoundTo = .T., ;
        Name = "Combo1"


    ADD OBJECT combo2 AS combobox WITH ;
        RowSourceType = 1, ;
        ControlSource = "crsTest.Fld1", ;
        Height = 24, ;
        Left = 17, ;
        Style = 2, ;
        Top = 47, ;
        Width = 208, ;
        Name = "Combo2"


    PROCEDURE Init
        CREATE CURSOR crsTest (Fld1 C(20))
        APPEND BLANK
        thisform.Combo1.AddListItem([ABC list],1, 1)
        thisform.Combo1.AddListItem([A,B,C]   ,1, 2)

        thisform.Combo1.AddListItem([DEF list],2, 1)
        thisform.Combo1.AddListItem([D,E,F]   ,2, 2)

        thisform.Combo1.AddListItem([GHI list],3, 1)
        thisform.Combo1.AddListItem([G,H,I]   ,3, 2)
        thisform.Combo1.Value = [A,B,C]
        thisform.Combo1.InteractiveChange()
    ENDPROC


    PROCEDURE combo1.InteractiveChange
        thisform.Combo2.RowSource = this.Value
        thisform.Combo2.Refresh()
        thisform.Combo2.ListIndex = 1
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform