Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox in Grid - Is end of current control width reache
Message
De
16/12/2003 13:44:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/12/2003 13:17:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00859578
Message ID:
00859587
Vues:
15
>I have the following code in the keypress of a textbox in a grid. The textbox is the last control in the grid row. When the user presses enter or tab in the control I move to the first control in the next row of the grid unless I have reached the last row in the grid where I then move to the next control outside the grid. This all works fine. However, I want to be able to determine if the user is leaving the control simply because the end of the control was reached (typed the maximum # of characters in the textbox) if set confirm is off. Any ideas? I imagine that should be trapped for in the lostfocus?
>
>TIA!
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF nShiftAltCtrl = 0
>   IF nKeyCode = 13 .OR. nKeyCode = 9
>      NODEFAULT
>      PRIVATE lcalias
>      lcalias=THISFORM.grid1.RECORDSOURCE
>      SELECT (lcalias)
>      PRIVATE thisno, totno
>      thisno=RECNO(lcalias)
>      totno = RECCOUNT(lcalias)
>      IF thisno < totno
>         SKIP
>         *THISFORM.grid1.refresh()
>         WITH THISFORM.grid1
>            *** Calculate the maximum number of rows in the grid
>            lnMaxRows = INT( ( .HEIGHT - .HEADERHEIGHT - ;
>               IIF( INLIST( .SCROLLBARS, 1, 3 ),;
>               SYSMETRIC( 8 ), 0 ) ) / .ROWHEIGHT )
>            IF .RELATIVEROW >= lnMaxRows
>               .DOSCROLL( 1 )
>            ENDIF
>            .ACTIVATECELL( .RELATIVEROW + 1, .ACTIVECOLUMN )
>         ENDWITH
>         THISFORM.grid1.column1.check1.SETFOCUS
>      ELSE	&& at last record go to next object
>         THISFORM.grid2.column1.check1.setfocus
>      ENDIF
>   ELSE
>		RETURN
>   ENDIF
>ELSE
>   RETURN
>ENDIF
>
Tracy,
Not tested but I think readkey() and 15 is the answer.
PS: Do a search for readkey(). I vaguely remember this.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform