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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GRID

Status
Not open for further replies.

mimosa

IS-IT--Management
Apr 4, 2002
25
US
Hi every body!
I wish to change the color of the cursor in a grid how to make?
Thanks for any help
 
I don't know of a way to change the color of the cursor, but you can use the MOUSEPOINTER property to change its shape.

Jim
 
If you're referring to the cursor that shows you which cell is active in the grid, check out the "SelectedForeColor" and "SelectedBackColor" of the individual controls in each column. By default, they are text boxes. So, to make a "red cursor" in the first column, set:

thisform.grid1.column1.text1.SelectedBackColor=RGB(255,0,0)
thisform.grid1.column1.text1.SelectedForeColor=RGB(255,255,255)

This will make the text in the selected box white with a red background, thus giving the appearance of a red cursor.
 
MyGird.InitEvent
DODEFAULT()
WITH THIS
.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)=THIS.inRecno, ;
RGB(0,255,0),RGB(255,255,192))","COLUMN")
ENDWITH
**EOF
====================================================
MyGrid.WhenEvent
This.inRecNo = RECNO()
RETURN .T.
====================================================
When the above codes are used in the said events of the grid control, the selected row will get the highlight.
This idea will help you to manipulate the colours ina similar way, as you want it.

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Create a form level variable inRecNo and make the initial value to 0 (Zero). In my previous posting, I forgot to mention this.
====================================================
MyGird.InitEvent
DODEFAULT()
WITH THIS
.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)=THIS.inRecno, ;
RGB(0,255,0),RGB(255,255,192))","COLUMN")
ENDWITH
**EOF
====================================================
MyGrid.WhenEvent
This.inRecNo = RECNO()
RETURN .T.
====================================================
When the above codes are used in the said events of the grid control, the selected row will get the highlight.
This idea will help you to manipulate the colours ina similar way, as you want it.

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
mimosa

If you want to use a number of different colour combinations and /or change the colours for individual cells in your grid, see FAQ184-624.

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top