谢谢了

解决方案 »

  1.   

    text.text = format(text1.text, "yyyy-mm-dd")
      

  2.   

    private sub text1_lostfocus()
       if trim(text1.text)="" then
           msgbox "请输入"
           text1.setfocus
           exit sub
       else
           if not isdate(text1.text) then
      

  3.   

    从控件中添加DTPicker控件Microsoft Windows Common Controls-2.60
    用Text覆盖DTPicker,Txt.Text=DTPicker.Value
    在Text的MouseDown事件中添加DTPicker.Show,在DTPicker的CloseUp事件中添加Txt.Text=DTPicker.Value这样绝对就是你要的格式了
      

  4.   

    用MaskEdBox控件吧,MaskEdBox1。Mask=0000-00-00
      

  5.   

    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
      

  6.   

    用MaskEdBox控件吧,MaskEdBox1。Mask=0000-00-00
      

  7.   

    用MaskEdBox控件吧,MaskEdBox1。Mask=0000-00-00
    请问那里可以找到这个控件?
    VB6有否?