用户按Enter键时如何转换星期几中的日期. [英] how to convert date in dayof week as user press enter key..

查看:71
本文介绍了用户按Enter键时如何转换星期几中的日期.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码...
我有一个数据网格视图,其中包含两列第一天和第二天(星期日星期一..ans等)我的问题是,随着用户在第一单元格中输入日期并按Enter键,光标应在下一个波纹管单元上移动,并且日期应增加按7天和日期列填充的是关联日期值(星期日星期一...)

here is my code ...
i have a data grid view which contain two column 1st date and 2nd day(Sunday Monday..ans so on)my problem is that as user enter date in fist cell and press enter key cursor should move on next bellow cell and date should increases by 7 day and date column fill with is associate date value (Sunday Monday...)

date                        day 
12/5/2005               Monday 
19/5/2005               Monday
26/5/2005               Monday 
03/6/2005               Monday
10/6/2005               Monday 
17/6/2005               Monday   this date should not greater than 31/12/2006



请帮助我的朋友

感谢和问候
lakhan AAnjana



please help me friends

thanks and regards
lakhan AAnjana

推荐答案

将此代码用于文本框的按键事件

如果asc(e.keycode)= 13,则
将dt dt作为新日期
dt ="26-12-2011"
将a变暗为integer = dt.dayofWeek()

如果a = 1则
msgbox(星期一")
elseif a = 2则
msgbox(星期二")
elseif a = 3然后
msgbox(星期三")
等等

如果
use this code into keypress event of text box

if asc(e.keycode)=13 then
dim dt as new date
dt="26-12-2011"
dim a as integer=dt.dayofWeek()

if a=1 then
msgbox("Monday")
elseif a=2 then
msgbox("Tuesday")
elseif a=3 then
msgbox("Wednesday")
so on

end if


这篇关于用户按Enter键时如何转换星期几中的日期.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆