Spread Windows Forms 10.0 Product Documentation
UseNegativeColor Property (GcTimeSpanCellType)
Example 


Gets or sets whether to use GcTimeSpan.NegativeColor to render negative values.
Syntax
'Declaration
 
Public Property UseNegativeColor As Boolean
'Usage
 
Dim instance As GcTimeSpanCellType
Dim value As Boolean
 
instance.UseNegativeColor = value
 
value = instance.UseNegativeColor
public bool UseNegativeColor {get; set;}

Property Value

true specifies to use GcTimeSpan.NegativeColor to render negative values; false specifies to use GcTimeSpan.ForeColor to render negative values.
The default is true.
Remarks
If the GrapeCity.Win.Value property is smaller than System.TimeSpan.Zero and the UseNegativeColor property is true, the text color uses this property.
Example
This example creates a GcTimeSpan cell.
GrapeCity.Win.Spread.InputMan.CellType.GcTimeSpanCellType gc = new GrapeCity.Win.Spread.InputMan.CellType.GcTimeSpanCellType();
gc.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows;
gc.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter;

gc.AlternateText.DisplayNull.ForeColor = Color.Red;
gc.AlternateText.DisplayNull.Text = "Display Null";
gc.AlternateText.Null.ForeColor = Color.Red;
gc.AlternateText.Null.Text = "Null value";
gc.AlternateText.DisplayZero.Text = "Display Zero";
gc.AlternateText.DisplayZero.ForeColor = Color.AliceBlue;
gc.AlternateText.Zero.Text = "Zero";
gc.AlternateText.Zero.ForeColor = Color.Azure;

gc.EditMode = GrapeCity.Win.Spread.InputMan.CellType.EditMode.Overwrite;
gc.ExitOnLastChar = true;

gc.Fields.Clear();
gc.Fields.AddRange("d.hh:mm:ss,7,.,,,-,");
gc.DisplayFields.Clear();
gc.DisplayFields.AddRange("d.hh:mm:ss,7,.,,,-,");
gc.DefaultActiveField = gc.Fields[1];

gc.FocusPosition = GrapeCity.Win.Spread.InputMan.CellType.FieldsEditorFocusCursorPosition.SelectAll;
gc.MaxMinBehavior = GrapeCity.Win.Spread.InputMan.CellType.MaxMinBehavior.Clear;

gc.NegativeColor = Color.Chocolate;
gc.PaintByControl = true;
gc.ShowRecommendedValue = true;

gc.SideButtons.Add(new GrapeCity.Win.Spread.InputMan.CellType.SpinButtonInfo());
gc.Spin.AllowSpin = true;
gc.Spin.Increment = 1;
gc.Spin.SpinOnKeys = true;
gc.Spin.SpinOnWheel = true;
gc.Spin.Wrap = true;

gc.UseNegativeColor = true;
gc.ValidateMode = GrapeCity.Win.Spread.InputMan.CellType.ValidateMode.ValidateNone;
gc.ValueSign = GrapeCity.Win.Spread.InputMan.CellType.ValueSignControl.Positive;
gc.UseSpreadDropDownButtonRender = true;

fpSpread1.ActiveSheet.Cells[0, 0].CellType = gc;
Dim GC As New GrapeCity.Win.Spread.InputMan.CellType.GcTimeSpanCellType()
GC.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows
GC.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter

GC.AlternateText.DisplayNull.ForeColor = Color.Red
GC.AlternateText.DisplayNull.Text = "Display Null"
GC.AlternateText.Null.ForeColor = Color.Red
GC.AlternateText.Null.Text = "Null value"
GC.AlternateText.DisplayZero.Text = "Display Zero"
GC.AlternateText.DisplayZero.ForeColor = Color.AliceBlue
GC.AlternateText.Zero.Text = "Zero"
GC.AlternateText.Zero.ForeColor = Color.Azure

GC.EditMode = GrapeCity.Win.Spread.InputMan.CellType.EditMode.Overwrite
GC.ExitOnLastChar = True

GC.Fields.Clear()
GC.Fields.AddRange("d.hh:mm:ss,7,.,,,-,")
GC.DisplayFields.Clear()
GC.DisplayFields.AddRange("d.hh:mm:ss,7,.,,,-,")
GC.DefaultActiveField = GC.Fields(1)

GC.FocusPosition = GrapeCity.Win.Spread.InputMan.CellType.FieldsEditorFocusCursorPosition.SelectAll
GC.MaxMinBehavior = GrapeCity.Win.Spread.InputMan.CellType.MaxMinBehavior.Clear

GC.NegativeColor = Color.Chocolate
GC.PaintByControl = True
GC.ShowRecommendedValue = True

GC.SideButtons.Add(New GrapeCity.Win.Spread.InputMan.CellType.SpinButtonInfo())
GC.Spin.AllowSpin = True
GC.Spin.Increment = 1
GC.Spin.SpinOnKeys = True
GC.Spin.SpinOnWheel = True
GC.Spin.Wrap = True

GC.UseNegativeColor = True
GC.ValidateMode = GrapeCity.Win.Spread.InputMan.CellType.ValidateMode.ValidateNone
GC.ValueSign = GrapeCity.Win.Spread.InputMan.CellType.ValueSignControl.Positive
GC.UseSpreadDropDownButtonRender = True

FpSpread1.ActiveSheet.Cells(0, 0).CellType = GC
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

GcTimeSpanCellType Class
GcTimeSpanCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.