Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking current grid row
Message
De
30/10/1998 06:26:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/10/1998 12:27:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00152154
Message ID:
00152668
Vues:
28
>>>I can dynamically disable all rows in a grid leaving only the
>>>current row enabled (after an append). However the user can still
>>>move the record pointer to another row by clicking. How can I
>>>prevent this ?
>>>
>>>Regards Ian
>>
>>Try BeforeRowColChange Event on the Grid
>>
>>Cheers
>
>I've been experimenting with this event, but still can't get the
>code within it from changing the recotd pointer ...
>
>Regards Ian
Ian,
This code is part of an brcc code from a class :
LPARAMETERS nColIndex
llChangingRow = .f.
with this
  if lastkey() = 145 && Adding new rec - class specific
	.nLastValidRec = .nCurrec && Class specific
  endif
  thisform.LockScreen = .lInGrid
  if mdown()
	lnBottom	= .top+.headerheight+.relativerow * .rowheight
	lnTop		= lnBottom - this.rowheight
	lnMouseRowPos	= mrow(wontop(),3)
	lnMouseColPos	= mcol(wontop(),3)
	llChangingRow	= !(between(lnMouseRowPos,lnTop, lnBottom) ;
	                  and between(lnMouseColPos,.left,.left+.width))
  else
       	llChangingRow	= inlist(lastkey(),24,5,18,3,145,148)
  endif
  * Some keys in list are class specific
  if llChangingRow
    * Your code here
    * nodefault prevents movement
  endif
endwith
If you're doing it for newly appended recs and doing tableupdate per row then just checking recno()<0 could be enough too.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform