Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox in Grid - Is end of current control width reached?
Message
De
16/12/2003 13:17:09
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Textbox in Grid - Is end of current control width reached?
Divers
Thread ID:
00859578
Message ID:
00859578
Vues:
67
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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform