Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how can i put a diferente colour in a grid line

Posted on 2011-03-06
4
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 43

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 43

Accepted Solution

by:
pcelba earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

730 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