Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Color for highlighted row in grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00530979
Message ID:
00532962
Vues:
15
Hi Joel,

There's also another technique that works well for this - the GetSysColor() API call.
declare integer GetSysColor in win32api integer
? getsyscolor(13) && Highlight backcolor
? getsyscolor(14) && Highlight forecolor
? getsyscolor(5) && Window (non-highlighted) backcolor
? getsyscolor(8) && Window forecolor
The full list of the parameter values are in the WINAPI Header files, or, more conveniently, in this KB article: HOWTO: Change the BackColor of a ToolBar When it is Docked (Q39291)

So you could change the SetAll calls to something less ugly that what I originally posted like (not tested):
this.setall("DynamicBackColor", "iif(recno() = this.nRecordNumber, GetSysColor(13), GetSysColor(5)", "Column")
this.setall("DynamicForeColor", "iif(recno() = this.nRecordNumber, GetSysColor(14), GetSysColor(8)", "Column")
Of course, you'd need to make sure that you'd declared the API call before the SetAll calls were made.

Cheers,

Andrew

>I am using the common technique of setting the DynamicBackColor and DynamicForeColor properties of all columns to highlight a row in a grid. I would like the color of the row to match the Windows Display Properties. I thought about adding a textbox as a property to the grid at runtime and getting the SelectedForeColor and SelectedBackColor properties from it. Is there a better way to do this, perhaps one that uses fewer clock cycles? I don't want to depend on a certain control being in a column.
>
>I noticed a different method mentioned on the ProFox list that uses a textbox to simulate highlighting the row instead of Dynamic color properties, but the download at leafe.com was corrupted. If someone wouldn't mind emailing this to me (jleach@mbs-intl.com), maybe I can kill two birds with one stone. Thanks.


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform