private sub text1_lostfocus() if trim(text1.text)="" then msgbox "请输入" text1.setfocus exit sub else if not isdate(text1.text) then
从控件中添加DTPicker控件Microsoft Windows Common Controls-2.60 用Text覆盖DTPicker,Txt.Text=DTPicker.Value 在Text的MouseDown事件中添加DTPicker.Show,在DTPicker的CloseUp事件中添加Txt.Text=DTPicker.Value这样绝对就是你要的格式了
用MaskEdBox控件吧,MaskEdBox1。Mask=0000-00-00
private sub text1_lostfocus() if trim(text1.text)="" then msgbox "请输入" text1.setfocus exit sub else if not isdate(text1.text) then msgbox "请输入日期型数据!",48,"提示" text1.setfocus exit sub else text1.text=format(text1.text,"yyyy-mm-dd") end if end if end sub
if trim(text1.text)="" then
msgbox "请输入"
text1.setfocus
exit sub
else
if not isdate(text1.text) then
用Text覆盖DTPicker,Txt.Text=DTPicker.Value
在Text的MouseDown事件中添加DTPicker.Show,在DTPicker的CloseUp事件中添加Txt.Text=DTPicker.Value这样绝对就是你要的格式了
if trim(text1.text)="" then
msgbox "请输入"
text1.setfocus
exit sub
else
if not isdate(text1.text) then
msgbox "请输入日期型数据!",48,"提示"
text1.setfocus
exit sub
else
text1.text=format(text1.text,"yyyy-mm-dd")
end if
end if
end sub
请问那里可以找到这个控件?
VB6有否?