10336 : Spaces before and after a timeitemtext?

Question

Hi, is there a way to have spaces before and after a timeitemtext, so that it is completely readable and not hidden by the link arrow?

Answer

On the time item text layout you can set Padding to reduce the rect that the time item text is drawn in.

TimeItemText titext1=new TimeItemText(); 
titext1.Text=”Sample text”; 
//titext1.TimeItemTextLayout=new TimeItemTextLayout(); 
titext1.TimeItemTextLayout=gantt1.TimeItemTextLayouts.GetFromName(“Default”); 
titext1.TimeItemTextLayout.Color=Color.PowderBlue; 
titext1.TimeItemTextLayout.Font=new Font(FontFamily.GenericMonospace,14,FontStyle.Bold); 
titext1.TimeItemTextLayout.Padding=new Rectangle(2,2,2,2);  // the rect is reduced with 2 pixels all around
titext1.TimeItemTextLayout.VertAlign=StringAlignment.Near; 
ti1.TimeItemTexts.Add(titext1); 

Leave a Reply