Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent and dblclick
Message
 
To
04/08/2008 09:30:58
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01336230
Message ID:
01336270
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>Can anyone give me an idea on why the following bindevent on the dblclick doesnt work?
>
>FOR lnCol = 1 TO ThisForm.Grid1.ColumnCount
> loColumn = ThisForm.Grid1.Columns[ lnCol ]
> FOR EACH loControl IN loColumn.Controls
> IF PEMSTATUS( loControl, [dblClick], 5 )
> BINDEVENT( loControl, 'dblClick', thisform, 'GridClicked') *** this doesnt work
> ENDIF
> *IF PEMSTATUS( loControl, [Click], 5 )
> * BINDEVENT( loControl, 'Click', thisform, 'GridClicked') *** this works just fine
> *ENDIF
> ENDFOR
>ENDFOR
>
>Looking for a little inspiration.
>
>Thanks
>
>Jon

That works for me:
oForm = CREATEOBJECT([form1])
oForm.Show(1)

**************************************************
*-- Form:         form1 (d:\all_zapl\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   08/04/08 07:44:00 PM
*
DEFINE CLASS form1 AS form


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


    ADD OBJECT grid1 AS grid WITH ;
        ColumnCount = 2, ;
        Height = 200, ;
        Left = 14, ;
        Top = 11, ;
        Width = 320, ;
        Name = "Grid1", ;
        Column1.Name = "Column1", ;
        Column2.Name = "Column2"


    PROCEDURE gridclicked
        WAIT WINDOW [We are here]  NOWAIT
    ENDPROC


    PROCEDURE Init
        =AFONT(laFonts)
        lcChars = []
        FOR lnFor = 30 TO 255
            lcChars = lcChars + CHR(lnFor)
        NEXT
        FOR lnFor = 1 TO ALEN(laFonts)
            INSERT INTO crsTest VALUES (laFonts[lnFor], lcChars)
        NEXT
        GO TOP
        thisform.Grid1.Column2.DynamicFontName = [IIF(.t.,ALLTRIM(FontNames),"")]
        FOR EACH oCol IN thisform.Grid1.Columns
            FOR EACH oControl IN oCol.Controls
                IF PEMSTATUS( oControl, [dblClick], 5 )
                   BINDEVENT( oControl, 'dblClick', thisform, 'GridClicked')
                ENDIF
            NEXT
        NEXT
    ENDPROC


    PROCEDURE Load
        CREATE CURSOR crsTest (FontNames C(50), AllChars C(200))
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
BTW what is the value of AllowCellSelection property of your grid?
If it is .F. then Grid DblClick is fired not column controls one.
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