找回密码
 立即注册

QQ登录

只需一步,快速开始

zjyfuhuo

注册会员

12

主题

17

帖子

194

积分

注册会员

积分
194

微信认证勋章

zjyfuhuo
注册会员   /  发表于:2018-6-19 09:38  /   查看:3088  /  回复:1
用的spread 8.0
其中有一个单元格类型设置为日期类型datetime
现在是当用户直接在单元格里输入小时和分钟后,例如8:20 ,直接显示为2018年1月1日 8:20
我想实现当用户录入小时和分钟后,直接显示当前日期的8:20 ,不用再另外点击日历控件进行选择  
请问怎么设置

1 个回复

倒序浏览
Helen
高级会员   /  发表于:2018-6-19 12:00:14
沙发
FarPoint.Web.Spread.DateTimeCellType datecell = new FarPoint.Web.Spread.DateTimeCellType();
            datecell.ErrorMessage = "Need a date!!!";
            datecell.FormatString = "d";
            datecell.DateTimeFormat.ShortDatePattern = "hh:mm";
            FpSpread1.ActiveSheetView.Columns[1].Width = 175;
            FpSpread1.ActiveSheetView.Cells[1, 1].CellType = datecell;
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部