回复 3楼qinbinghao的帖子
VB.NET 代码如下:
- Imports FarPoint.Win.Spread.CellType
- Public Class Form1
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- Dim myType As New MyCurrecyCellType()
- myType.DecimalPlaces = 0
- Me.FpSpread1.Sheets(0).Columns(0).CellType = myType
- End Sub
- End Class
- Class MyCurrecyCellType
- Inherits NumberCellType
- Public Overrides Function Format(obj As Object) As String
- Dim formatstr As String = ""
- If obj IsNot Nothing Then
- formatstr = obj.ToString() & "$"
- End If
- Return formatstr
- End Function
- End Class
复制代码 |