Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox and Filter
Message
 
À
23/12/2004 07:40:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00971725
Message ID:
00971762
Vues:
20
Here an example based on Marcia's code:
CREATE CURSOR Customer (Company C(20), Country N(3))
FOR asd = 1 TO 10
    INSERT INTO Customer VALUES ("Company"+TRANSFORM(asd), asd)
NEXT
CREATE CURSOR Country (cntrName C(20), Country N(3))
FOR asd = 1 TO 10
    INSERT INTO Country VALUES ("Country"+TRANSFORM(asd), asd)
NEXT

mForm = CREATEOBJECT("Form1")
mForm.Show(2)
READ EVENTS




DEFINE CLASS form1 AS form
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"

    ADD OBJECT list1 AS listbox WITH ;
        BoundColumn = 1, ;
        ColumnCount = 2, ;
        ColumnWidths = "150", ;
        RowSourceType = 6, ;
        RowSource = "customer.company,country", ;
        Height = 121, ;
        Left = 75, ;
        Top = 87, ;
        Width = 258, ;
        Name = "List1"


    ADD OBJECT combo1 AS combobox WITH ;
        RowSourceType = 6, ;
        RowSource = "country.cntrName, country", ;
        BoundColumn=2,;
        BoundTo=.t.,;
        Height = 24, ;
        Left = 76, ;
        Top = 25, ;
        Width = 220, ;
        Name = "Combo1"


    PROCEDURE combo1.Valid
        LOCAL lcFilter
        SELECT Customer
        lcFilter = [country = ] + ALLTRIM( this.Value  )
        SET FILTER TO &lcFilter
        GO TOP
        Thisform.List1.Requery()
    ENDPROC

    PROCEDURE Destroy
         CLEAR EVENTS
    ENDPROC

ENDDEFINE
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
Répondre
Fil
Voir

Click here to load this message in the networking platform