Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlighting grid textbox when clicking

Status
Not open for further replies.

superfloors

Programmer
Dec 22, 2000
1
US
I would like some of my grids to function so that when I click on a particular cell, the text in that cell is highlighted. Currently, when I click in a cell the cell is selected but the cursor shows up in the middel of the text.
 
superfloors

This subject has been recently covered in thread184-41469

One way is to add a new form property called .nRecordNo

In the .Init event of grid1 put:-

THISFORM.nRecordNo = RECNO(
)

WITH THIS
.SetAll([DynamicBackColor],"IIF(RECNO(
)=THISFORM.nRecordNo,RGB(0,0,128),RGB(255,255,255))",[Column])
.SetAll([DynamicForeColor],"IIF(RECNO(
)=THISFORM.nRecordNo,RGB(255,255,255),RGB(0,0,0))",[Column])
.Refresh()
ENDWITH

In the .AfterRowColChange event of grid1 put:-

WITH THISFORM
.nRecordNo = RECNO(
)
.grid1.Refresh()
ENDIF

Hope this helps

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top