Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display combo with no selection
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01026750
Message ID:
01027015
Views:
11
>>Both Ctrl+0 and ListIndex=0 works for me to reset (maybe you tried Ctrl+letterO, Ctrl+Zero should it be).
>>Cetin
>
>I'm trying in run-time to press Ctrl+ zero, but nothing happens, e.g. the selection remains.

This works, with Cetin's suggestion:
m1= CREATEOBJECT("Form1")
m1.Show(1)


**************************************************
*-- Form:         form1 (c:\mmviscollect\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/28/05 09:29:05 AM
*
DEFINE CLASS form1 AS form


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


    ADD OBJECT combo1 AS combobox WITH ;
        BoundColumn = 2, ;
        Height = 24, ;
        ColumnCount = 2, ;
        Left = 72, ;
        Style = 2, ;
        Top = 60, ;
        BoundTo = .f., ;
        Width = 156, ;
        Name = "Combo1"

    PROCEDURE combo1.Init
        CREATE CURSOR cTest (cUserID C(5), cEmpName C(50))
        FOR asd = 1 TO 4
            INSERT INTO cTest VALUES (TRANSFORM(asd),"User "+TRANSFORM(asd))
        NEXT
        FOR asd = 1 TO 4
            INSERT INTO cTest (cEmpName) VALUES ("User "+TRANSFORM(asd+5))
        NEXT



        thisform.cUserID = ""
        SELECT DISTINCT cUserID, cEmpName ;
               FROM cTest;
               INTO CURSOR c_AllEmployees

        thisform.combo1.rowsourcetype = 3
        thisform.combo1.rowsource = ;
                    "SELECT distinct cEmpName, cUserID " + ;
                    "FROM c_AllEmployees" + ;
                    " INTO CURSOR c_AllEmployees " + ;
                    "ORDER BY 1"
        thisform.combo1.controlsource = 'thisform.cUserID'
        thisform.combo1.ListIndex = 0 
        KEYBOARD '{CTRL+0}' 
    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