Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Highlighting a Grid Row
Message
De
18/05/1998 00:59:30
 
 
À
17/05/1998 05:52:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00099972
Message ID:
00100037
Vues:
92
>I am trying to get the active grid row (2 columns) to be highlighted and remain highlighted when the focus is moved on. I know DynamicBackColor may be used, but it doesn't seem to work. I've tried some previous suggestions, but they did not work - can anyone give simple instructions.
>
>Thanks in advance.

You can use the dynamic properties - the only problem is that if you don't use them right you get slow performance
to avoid that you can you can create a sub-class of a grid :
add 3 properties

lok,nbackcolor(and /or forecolor) and nRecno

Grid Valid Event :
this.lok=.f.
return .T.

Grid When Event :
this.lok=.t.

Grid BeforeRowColChange

LPARAMETERS nColIndex
if this.lok
this.nRecNo=-99999
endif
in the Grid's Init event you can do something like

this.nRecno=recno()
this.setall("DynamicBackColor",;
"IIF(recno()=this.nRecno, ;
this.nBackColor,this.Backcolor)","Column")
this.setall("BackColor",(this.nBackColor),"GrdTextBox") && no need to set sparse to .f.

GrdTextBox is a subclass of textbox that should be used inside each grid column
with the following code in the GotFocus event:

this.parent.parent.nRecno=Recno()


Arnon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform