Spread Windows Forms 7.0 Product Documentation
Changed Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > NamedStyleCollection Class : Changed Event


Glossary Item Box

Occurs when a style is added, removed, or changed in the collection.

Syntax

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

Event Data

The event handler receives an argument of type NamedStyleCollectionEventArgs containing data related to this event. The following NamedStyleCollectionEventArgs properties provide information specific to this event.

PropertyDescription
NewStyle Gets the new style that was added, or null if no style was added.
OldStyle Gets the old style that was removed or changed, or null if no style was removed or changed.
Type Gets the type of event that occurred.

Example

This example causes the Changed event to occur for the NamedStyleCollection object.
C#Copy Code
FarPoint.Win.Spread.NamedStyleCollection myCollection;

private void Form1_Load(object sender, System.EventArgs e)
{
this.myCollection = new FarPoint.Win.Spread.NamedStyleCollection();
this.myCollection.Changed += new FarPoint.Win.Spread.NamedStyleCollectionEventHandler(this.myCollection_Changed);
}

private void menuItem1_Click(object sender, System.EventArgs e)
{
FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle();
myCollection.Add(ns);
}

private void myCollection_Changed(object sender, FarPoint.Win.Spread.NamedStyleCollectionEventArgs e)
{
listBox1.Items.Add("Changed Event Fired");
} 
Visual BasicCopy Code
Friend WithEvents myCollection As FarPoint.Win.Spread.NamedStyleCollection

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
myCollection = New FarPoint.Win.Spread.NamedStyleCollection()
Dim ns As New FarPoint.Win.Spread.NamedStyle()
myCollection.Add(ns)
End Sub

Private Sub myCollection_Changed(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.NamedStyleCollectionEventArgs) Handles
myCollection.Changed
ListBox1.Items.Add("Changed Event Fired")
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.