10742 : How do I change the font color (forecolor) of a time item?

Question

Hi, I allow customers to color code schedules. How do I change the font color (forecolor) of a time item?

Answer

There are properties on the IphGantX interface that controls font things:

TimeItemTextFont1 
TimeItemTextFont1Color 
TimeItemTextFont2 
TimeItemTextFont2Color 
TimeItemTextFont3 
TimeItemTextFont3Color 

There are three different fonts to choose from. You choose which one to use when you set ithe values on the TimeItemText IphDataEntity_GantTime2.TimeItemsTextSet.

  Set gr = de.GantRow
  gr.TimeItems_CanChangeRow = False
  gr.TimeItems_CanMove = True

  Set gt = phGantX1.AddGantTime(de, 0)
  gt.Style = tsNormal
  gt.Start = Date
  gt.Stop = Date + 5

  gt.TimeItemsTextAdd
  gt.TimeItemsTextSet 0, de.Text, 2, 2, 0 <- index zero -> font1