Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting a Grid Row
Message
From
17/05/1998 10:59:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/05/1998 05:52:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00099972
Message ID:
00099986
Views:
16
>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 mean remain highligthed when moved outside of grid or also when focus has ? Dynamicbackcolor works. Just set the dynamiccolor+textbox color props. Below code is addition&modification to "highligthed" class in Files\classes section gridx.zip.
* Highlight 2 and 4th columns of grid.
* Grid.init
WITH this
	IF !empty(.RecordSource)
		.nCurRec = recno(this.RecordSource)
		cBkColor = "IIF(RecNo(This.RecordSource) = This.nCurRec," + ;
			str(this.cCurRecBackColor)+","+str(this.BackColor)+")"
		cFrColor = "IIF(RecNo(This.RecordSource) = This.nCurRec," + ;
			str(this.cCurRecForeColor)+","+str(this.ForeColor)+")"
		this.columns(2).dynamicbackcolor = cBkColor
		this.columns(4).dynamicbackcolor = cBkColor
		this.columns(2).dynamicforecolor = cFrColor
		this.columns(4).dynamicforecolor = cFrColor
	ENDIF
ENDWITH

* Columns(2) and columns(4).text1.gotfocus
with this.parent.parent
	this.backcolor		= .cCurRecBackColor
	this.selectedbackcolor	= .cCurRecBackColor
	this.forecolor		= .cCurRecForeColor
	this.selectedforecolor	= .cCurRecForeColor
endwith

* Columns(2) and columns(4).text1.lostfocus
this.resettodefault("backcolor")
this.resettodefault("selectedbackcolor")
this.resettodefault("forecolor")
this.resettodefault("selectedforecolor")
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
Previous
Reply
Map
View

Click here to load this message in the networking platform