高分求教:关于Spread的问题(至急)。

haodp 2008-07-02 06:06:37
怎么使用GeneralCellType而不使用NumberCellType控制整数部分的长度。理由:使用NumberCellType时,不能使用del,backspace消除小数部分。
当然如果能够使用代码实现del,backspace消除spread入力值得小数部分的话,更好。
'spread
Dim genlcell As New FarPoint.Win.Spread.CellType.GeneralCellType()
Dim numform As System.Globalization.NumberFormatInfo = CType(System.Globalization.NumberFormatInfo.CurrentInfo.Clone(), System.Globalization.NumberFormatInfo)
numForm.NumberDecimalDigits = 2
numForm.NumberDecimalSeparator = "."
numForm.NegativeSign = ""


genlcell.NumberFormat = numform

FpSpread1.ActiveSheet.Cells(0, 0).CellType =genlcell

但是不能控制整数部分长度。请问那位大哥帮忙解决一下。

100分不够的话,可以给尽我所有的csdn分,只要能够解决问题。至急求教。
...全文
142 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
haodp 2008-07-03
  • 打赏
  • 举报
回复
NumberCellType当然可以设置小数位数拉。

objColNumCellType.DecimalPlaces = 3

谢谢楼上的两位,我的问题解决啦。用比较旁门左道的方法解决啦。仍然谢谢两位拉。
ejoe313 2008-07-03
  • 打赏
  • 举报
回复
numForm.NumberDecimalDigits = 0
这样不就没有小数位了吗?
ejoe313 2008-07-03
  • 打赏
  • 举报
回复
NumberCellType,是不是可以设置小数位数的
江城老温 2008-07-02
  • 打赏
  • 举报
回复
做什么的类库?好象第一次见到。FarPoint?

16,717

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧