Spread ASP.NET 6.0 Product Documentation
Changed Event
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > NamedStyle Class : Changed Event


Glossary Item Box

Occurs when the named style has changed.

Syntax

Visual Basic (Declaration) 
Public Event Changed As EventHandler
Visual Basic (Usage)Copy Code
Dim instance As NamedStyle
Dim handler As EventHandler
 
AddHandler instance.Changed, handler
C# 
public event EventHandler Changed

Remarks

The event handler receives an argument of type EventHandler containing data related to this event.

Example

This example changes the background color for the named style.
C#Copy Code
protected FarPoint.Web.Spread.NamedStyle ns;
protected FarPoint.Web.Spread.NamedStyleCollection nsc;

nsc = new FarPoint.Web.Spread.NamedStyleCollection();
ns = new FarPoint.Web.Spread.NamedStyle("StyleData", "DataAreaDefault");
ns.BackColor = Color.LightBlue;
ns.Border = new FarPoint.Web.Spread.Border(Color.Red);
ns.Parent = "DataAreaDefault";
nsc.Add(ns);
FpSpread1.NamedStyles.Add(nsc[0]);
FpSpread1.ActiveSheetView.SetText(0, 0, "NamedStyle");
FpSpread1.ActiveSheetView.Columns[0].Width = 120;
FpSpread1.ActiveSheetView.Rows[0].Height = 80;
FpSpread1.ActiveSheetView.DefaultStyle = nsc[0];

ns.Changed += new EventHandler(nsChanged);

private void Button1Click(object sender, System.EventArgs e)
{
     ns.BackColor = Color.Yellow;
}

private void nsChanged(object sender, EventArgs e)
{
     Response.Write("The new back color is " + ns.BackColor.ToString());
}
Visual BasicCopy Code
Friend WithEvents ns As FarPoint.Web.Spread.NamedStyle
Friend WithEvents nsc As FarPoint.Web.Spread.NamedStyleCollection

nsc = New FarPoint.Web.Spread.NamedStyleCollection
ns = New FarPoint.Web.Spread.NamedStyle("StyleData", "DataAreaDefault")
ns.BackColor = Color.LightBlue
ns.Border = New FarPoint.Web.Spread.Border(Color.Red)
ns.Parent = "DataAreaDefault"
nsc.Add(ns)
FpSpread1.NamedStyles.Add(nsc(0))
FpSpread1.ActiveSheetView.SetText(0, 0, "NamedStyle")
FpSpread1.ActiveSheetView.Columns(0).Width = 120
FpSpread1.ActiveSheetView.Rows(0).Height = 80
FpSpread1.ActiveSheetView.DefaultStyle = nsc(0)
Dim eh As System.EventHandler = AddressOf nsChanged
AddHandler ns.Changed, eh

Private Sub Button1Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     ns.BackColor = Color.Yellow
End Sub

Private Sub nsChanged(ByVal sender As Object, ByVal e As System.EventArgs)
     Response.Write("The new back color is " & ns.BackColor.ToString())
End Sub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.