找回密码
 立即注册

QQ登录

只需一步,快速开始

turboming

注册会员

16

主题

57

帖子

179

积分

注册会员

积分
179
turboming
注册会员   /  发表于:2019-11-29 14:31  /   查看:3034  /  回复:5
想要同时满足
1.录入的最大字节长度是2
2.IMEMode是全角
image.png537568969.png

image.png515906676.png
vb6实现的source是spread.CellType = 1,spread.TypeEditCharSet = 6,spread.TypeMaxEditLen = 2
升级到.net以后
如果spread中列的cellType是Text时TextCellType.CharacterSet = FarPoint.Win.Spread.CellType.CharacterSet.AllIME可以实现2没有找到属性能实现1


如果spread中列的cellType是gcTextBox时
gcTextBox.MaxLengthUnit = GrapeCity.Win.Spread.InputMan.CellType.LengthUnit.Byte
gcTextBox.MaxLength = 2可以实现1没有找到属性能实现2


请问有什么方法能同时实现1和2吗

5 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-12-3 10:10:32
沙发
您好TextCellType 也有MaxLength属性

   FarPoint.Win.Spread.CellType.TextCellType tct = new FarPoint.Win.Spread.CellType.TextCellType();
            tct.MaxLength = 2;
回复 使用道具 举报
turboming
注册会员   /  发表于:2019-12-4 14:21:17
板凳
dexteryao 发表于 2019-12-3 10:10
您好TextCellType 也有MaxLength属性

   FarPoint.Win.Spread.CellType.TextCellType tct = new FarPoin ...

好的 解决了 不过用的还是gctextbox 又拖来一个gcime控件使得gctextbox有imemode的属性了。textcelltype的maxlength按字符数比较的不是按字节数。所以我就没用。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-12-4 15:55:13
地板
好的,解决就好。 。此贴关闭,有问题开新帖。
回复 使用道具 举报
turboming
注册会员   /  发表于:2019-12-4 16:03:49
5#
dexteryao 发表于 2019-12-4 15:55
好的,解决就好。 。此贴关闭,有问题开新帖。

已开
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-12-4 16:08:13
6#
好的
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部