FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Set Color in a cell on load
Set Color in a cell on load
Débuté par John Marrone, 01 juil. 2004 14:27 - 4 réponses
Connectez-vous…
John Marrone
#1
Posté le 01 juillet 2004 - 14:27
I want to set the color of a cell in my table based on if the cells value equals a certain value. Here is my code and it works when I move to a new row. But I want it to work when the table comes up on the screen. Like in the row init event. Does anybody know where to put the code so when the window appears the cells are in the correct color. Thanks in advance.
LOCAL
RowNum is int = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
John Marrone
Signaler
0
0
Christoph Erdmann
#2
Posté le 01 juillet 2004 - 14:40
Hi John,
try in the table : Row display of table.
Christoph
I want to set the color of a cell in my table based on if the cells value equals a certain value. Here is my code and it works when I move to a new row. But I want it to work when the table comes up on the screen. Like in the row init event. Does anybody know where to put the code so when the window appears the cells are in the correct color. Thanks in advance.
LOCAL
RowNum is int = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
John Marrone
Signaler
0
0
John Marrone
#3
Posté le 01 juillet 2004 - 15:05
Christoph
This only works after the window has been displayed and I change the current row by clicking on an other row or using the arrow keys to change the row. There has to be a way??
John
Hi John,
try in the table : Row display of table.
Christoph
I want to set the color of a cell in my table based on if the cells value equals a certain value. Here is my code and it works when I move to a new row. But I want it to work when the table comes up on the screen. Like in the row init event. Does anybody know where to put the code so when the window appears the cells are in the correct color. Thanks in advance.
LOCAL
RowNum is int = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
John Marrone
Signaler
0
0
John Marrone
#4
Posté le 01 juillet 2004 - 15:49
Christoph
Figured it out. Had to put the following code in 2 places as follows.
Had to put this code in the END OF Initalization OF TABLE :
LOCAL
RowNum is int
i is a int
WHEN EXCEPTION IN
FOR i = 1 TO HNbRec( DEMO_QryTest)
RowNum = i
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
HReadNext(DEMO_QryTest)
END
DO
END
Had to put this code in the Row Display of TABLE :
LOCAL
RowNum is int
RowNum = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
Hope this helps others.
John Marrone
P.S. I have been wanting to use this smily for a while now.
Hi John,
try in the table : Row display of table.
Christoph
I want to set the color of a cell in my table based on if the cells value equals a certain value. Here is my code and it works when I move to a new row. But I want it to work when the table comes up on the screen. Like in the row init event. Does anybody know where to put the code so when the window appears the cells are in the correct color. Thanks in advance.
LOCAL
RowNum is int = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
John Marrone
Signaler
0
0
Bert
#5
Posté le 01 juillet 2004 - 16:03
Try: In the row display code section
IF Middle(RaceID[table],1,1) = "A" THEN
Table_DEMO_QryTest[table]..BrushColor = iLightRed
Bert
I want to set the color of a cell in my table based on if the cells value equals a certain value. Here is my code and it works when I move to a new row. But I want it to work when the table comes up on the screen. Like in the row init event. Does anybody know where to put the code so when the window appears the cells are in the correct color. Thanks in advance.
LOCAL
RowNum is int = CurrentSubscript()
IF RowNum = 0 THEN RowNum = 1
IF Middle(RaceID,1,1) = "A" THEN
Table_DEMO_QryTest[RowNum][1]..BrushColor = iLightRed
ELSE
Table_DEMO_QryTest[Table_DEMO_QryTest]..BrushColor = iDefaultColor
END
John Marrone
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte