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


Gets or sets the initial cursor position when the editor gets focus.
Syntax
'Declaration
 
Public Property FocusPosition As FieldsEditorFocusCursorPosition
'Usage
 
Dim instance As GcTimeSpanCellType
Dim value As FieldsEditorFocusCursorPosition
 
instance.FocusPosition = value
 
value = instance.FocusPosition
public FieldsEditorFocusCursorPosition FocusPosition {get; set;}
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.