Spread Windows Forms 6.0 Product Documentation
DateTimeFormat Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > GeneralCellType Class : DateTimeFormat Property


Glossary Item Box

Gets or sets a DateTimeFormatInfo object that defines the format for displaying dates and times.

Syntax

Visual Basic (Declaration) 
Public Overridable Property DateTimeFormat As DateTimeFormatInfo
Visual Basic (Usage)Copy Code
Dim instance As GeneralCellType
Dim value As DateTimeFormatInfo
 
instance.DateTimeFormat = value
 
value = instance.DateTimeFormat
C# 
public virtual DateTimeFormatInfo DateTimeFormat {get; set;}

Property Value

DateTimeFormatInfo object containing the format for date and time values

Example

This example specifies the format string used to format the date value.
C#Copy Code
FarPoint.Win.Spread.CellType.GeneralCellType genlcell = new FarPoint.Win.Spread.CellType.GeneralCellType();
System.Globalization.DateTimeFormatInfo dtinfo; 
dtinfo = System.Globalization.DateTimeFormatInfo.CurrentInfo;
genlcell.DateTimeFormat = dtinfo;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = genlcell;
fpSpread1.ActiveSheet.Cells[0, 0].Value = DateTime.Now;
Visual BasicCopy Code
Dim genlcell As New FarPoint.Win.Spread.CellType.GeneralCellType()
Dim dtinfo As New System.Globalization.DateTimeFormatInfo()
genlcell.DateTimeFormat = dtinfo.CurrentInfo
FpSpread1.ActiveSheet.Cells(0, 0).CellType = genlcell
FpSpread1.ActiveSheet.Cells(0, 0).Value = DateTime.Now

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.