Solved

how can i put a diferente colour in a grid line

Posted on 2011-03-06
4
349 Views
Last Modified: 2012-05-11
how can I put different colors in the lines of a visual foxpro grid so as to highlight certain items.
thanks
0
Comment
Question by:luciliacoelho
  • 2
4 Comments
 
LVL 41

Expert Comment

by:pcelba
ID: 35048418
You may use DynamicForeColor and DynamicBackColor of the Column. To highlite each the second line you may use following code:

THIS.setall("Dynamicbackcolor", "IIF(RECNO()%2=0,RGB(255,255,0),RGB(192,192,192))","Column")

in Grid.Init method code.
0
 

Author Comment

by:luciliacoelho
ID: 35048612
thanks very much, for the topics. What i want is to change the color of the line numer p.e. 100.
0
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 35048915
So, I hope you don't need an update but here it is:

THIS.setall("Dynamicbackcolor", "IIF(RECNO() = 100,RGB(255,255,0),RGB(192,192,192))","Column")

You just have to keep the dynamic expression shorter than 255 characters.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 35053370
You can also use ICASE() instead of IF() for more choices
ICASE(logical1,color1,logical2,color2,...,colorn)

Or you can call a function that returns a color.
CategoryColor(query.category)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now