MultiRow4升级10 GcNumberCell的问题
本帖最后由 xiaoaj 于 2021-7-29 10:35 编辑原4.0的代码:
objSeibiEditor.DisplayFormat = New GrapeCity.Win.ElTabelle.Editors.NumberFormat("#,##0.##", "", "", "-", "", "", "")
bjSeibiEditor.Format = New GrapeCity.Win.ElTabelle.Editors.NumberFormat("#,##0.##", "", "", "-", "", "", "")
If Me.cmbMode.SelectedValue.ToString = MC.SyoriKubun.Jyutyu.ModePrint Then
objSeibiEditor.MinValue = -9999.99D
objSeibiEditor.ValueSign = GrapeCity.Win.ElTabelle.Editors.ValueSign.NoControl
Else
objSeibiEditor.MinValue = 0
objSeibiEditor.ValueSign = GrapeCity.Win.ElTabelle.Editors.ValueSign.Positive
End If
Me.mrowSeibiBuhin.MRows(i).Item("XXX").Editor = objSeibiEditor
现10.0封装了与之对应的类
Public Class NumberEditor
Inherits GrapeCity.Win.MultiRow.InputMan.GcNumberCell
WriteOnly Property DisplayFormat As NumberFormat
Set(value As NumberFormat)
MyBase.DisplayFields.AddRange(value.Digit, value.PositivePrefix, value.PositiveSuffix, value.NegativePrefix, value.NegativeSuffix)
End Set
End Property
WriteOnly Property Format As NumberFormat
Set(value As NumberFormat)
MyBase.Fields.SetFields(value.Digit, value.PositivePrefix, value.PositiveSuffix, value.NegativePrefix, value.NegativeSuffix)
End Set
End Property
End Class
Public Class NumberFormat
Property Digit As String
Property PositivePrefix As String
Property PositiveSuffix As String
Property NegativePrefix As String
Property NegativeSuffix As String
Property ZeroString As String
Property NullPart As String
Public Sub New(ByVal digit As String, ByVal positivePrefix As String, ByVal positiveSuffix As String, ByVal negativePrefix As String, ByVal negativeSuffix As String, ByVal zeroString As String, ByVal nullPart As String)
Me.Digit = digit
Me.PositivePrefix = positivePrefix
Me.PositiveSuffix = positiveSuffix
Me.NegativePrefix = negativePrefix
Me.NegativeSuffix = negativeSuffix
Me.ZeroString = zeroString
Me.NullPart = nullPart
End Sub
End Class
由于DisplayFormat 和Format 的原因吧,负数总是显示成0,不知道在这中间Format的设置哪不正确,
请帮忙看一下!多谢!
帮你做了一个demo, 可以参考这里的代码
页:
[1]