Occurs when a style is added, removed, or changed in the collection.
Syntax
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.
Property | Description |
---|
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 Basic | Copy 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