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 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