Spread 6 自定义公式,测试可行,但是没有使用参数
参数如何设置啊,比如AAA("参数")
Imports FarPoint.CalcEngine
Public Class CustomFormulas
Inherits FunctionInfo
Public _Name As String = String.Empty
Public _MinArgs As Integer = 0
Public _MaxArgs As Integer = 0
Public Sub New(ByVal formulaName As String)
_Name = formulaName
End Sub
Public Overrides ReadOnly Property Name() As String
Get
Return _Name
End Get
End Property
Public Overrides ReadOnly Property MaxArgs() As Integer
Get
Return _MaxArgs
End Get
End Property
Public Overrides ReadOnly Property MinArgs() As Integer
Get
Return _MinArgs
End Get
End Property
Public Overrides Function Evaluate(ByVal args As Object()) As Object
Return "OK"
End Function
End Class
/////////////////////////////////////////
Dim myFormulas As New TsGrid.CustomFormulas("AAA")
myFormulas._Name = "AAA"
Me.TsGridArea.ActiveSheet.AddCustomFunction(myFormulas)
Me.TsGridArea.ActiveSheet.SetFormula(1, 1, "AAA()") |
|