Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement