Friend WithEvents nsc As FarPoint.Win.Spread.NamedStyleCollection
Dim ns As FarPoint.Win.Spread.NamedStyle() = {New FarPoint.Win.Spread.NamedStyle("Style1"),
New FarPoint.Win.Spread.NamedStyle("Style2"),
New FarPoint.Win.Spread.NamedStyle("Style3")}
nsc = New FarPoint.Win.Spread.NamedStyleCollection
Dim eh As FarPoint.Win.Spread.NamedStyleCollectionEventHandler = AddressOf nscChanged
AddHandler nsc.Changed, eh
ns(0).Font = New Font("Comic Sans Serif", 12)
ns(0).Name = "StyleHeaders"
ns(0).Parent = "HeaderDefault"
nsc.AddRange(ns)
FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = ns(0)
Private Sub nscChanged(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.NamedStyleCollectionEventArgs) Handles nsc.Changed
MessageBox.Show(e.NewStyle.Name)
End Sub