Spread Windows Forms 7.0 Product Documentation
TimePeriodConditionalFormattingRule Constructor(TimePeriod)
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > TimePeriodConditionalFormattingRule Class > TimePeriodConditionalFormattingRule Constructor : TimePeriodConditionalFormattingRule Constructor(TimePeriod)


period
The period.

Glossary Item Box

Initializes a new instance of the TimePeriodConditionalFormattingRule class.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal period As TimePeriod _
)
Visual Basic (Usage)Copy Code
Dim period As TimePeriod
 
Dim instance As New TimePeriodConditionalFormattingRule(period)
C# 
public TimePeriodConditionalFormattingRule( 
   TimePeriod period
)

Parameters

period
The period.

Example

This example creates a conditional rule.
C#Copy Code
private void Form1_Load(object sender, EventArgs e)
        {
            fpSpread1.Sheets[0].Cells[1, 1].Value = DateTime.Now;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //Date Occurs CF
            FarPoint.Win.Spread.TimePeriodConditionalFormattingRule time = new FarPoint.Win.Spread.TimePeriodConditionalFormattingRule(FarPoint.Win.Spread.TimePeriod.Last7Days);
            time.TimePeriod = FarPoint.Win.Spread.TimePeriod.Last7Days;
            time.ForeColor = Color.Magenta;
            fpSpread1.ActiveSheet.SetConditionalFormatting(1, 1, time);
        }
VB.NETCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
        FpSpread1.Sheets(0).Cells(1, 1).Value = Date.Now
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Date Occurs CF
        Dim time As New FarPoint.Win.Spread.TimePeriodConditionalFormattingRule(FarPoint.Win.Spread.TimePeriod.Last7Days)
        time.TimePeriod = FarPoint.Win.Spread.TimePeriod.Last7Days
        time.ForeColor = Color.DarkMagenta
        FpSpread1.ActiveSheet.SetConditionalFormatting(1, 1, time)
    End Sub

Requirements

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

See Also

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