找回密码
 立即注册

QQ登录

只需一步,快速开始

chcchb
论坛元老   /  发表于:2012-6-27 09:16  /   查看:5134  /  回复:4
默认是none 改成 text后能出现 MaxLength 这时设置保存后,运行了下,长度设置没什么效果
在对应的.Designer.vb查看了下,有如下代码:
        TextCellType11.MaxLength = 4
        Me.FpSpreadView_Sheet1.Columns.Get(0).CellType = TextCellType11
        Me.FpSpreadView_Sheet1.Columns.Get(0).Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
        Me.FpSpreadView_Sheet1.Columns.Get(0).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left
        Me.FpSpreadView_Sheet1.Columns.Get(0).Width = 55.0!

难道一定要在后台代码里设置?

啊,发错板块了,这个要发在   Spread for WinForm & ActiveX  板块
版主帮挪一下

4 个回复

倒序浏览
chcchb
论坛元老   /  发表于:2012-6-27 09:21:00
沙发
自己在后台试了下,代码如下:
           Dim txtCell As New FarPoint.Win.Spread.CellType.TextCellType()
            txtCell.MaxLength = 4
            For i As Integer = 0 To 43
                Me.FpSpreadView_Sheet1.Columns(i).CellType = txtCell
            Next
这个时候 这个maxLength起到效果了...
回复 使用道具 举报
chcchb
论坛元老   /  发表于:2012-6-27 09:37:00
板凳
搞定了.
回复 使用道具 举报
chcchb
论坛元老   /  发表于:2012-6-27 09:42:00
地板
原因是一开始后台里的也有设置,把属性那里的覆盖引起的..
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2012-6-27 10:53:00
5#
哈哈,解决就好。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部