用TextBox和MonthView MonthView的Visible设为FalsePrivate Sub MonthView1_DateClick(ByVal DateClicked As Date) Text1.Text = MonthView1.Value MonthView1.Visible = False End SubPrivate Sub Text1_Click() MonthView1.Visible = True End Sub
dtpicker and textbox :Private Sub Command1_Click() Dim d As String d = InputBox("please enter a date", , "2004-1-1") If d = "" Then Text1.Visible = True Else Text1.Visible = False DTPicker1.Value = CDate(d) End If End SubPrivate Sub Form_Load() Text1.Move DTPicker1.Left, DTPicker1.Top, DTPicker1.Width - 250, DTPicker1.Height Text1.Visible = False Text1.Text = "" DTPicker1.UpDown = True End Sub
bbs.ruichen.net
MonthView的Visible设为FalsePrivate Sub MonthView1_DateClick(ByVal DateClicked As Date)
Text1.Text = MonthView1.Value
MonthView1.Visible = False
End SubPrivate Sub Text1_Click()
MonthView1.Visible = True
End Sub
Dim d As String
d = InputBox("please enter a date", , "2004-1-1")
If d = "" Then
Text1.Visible = True
Else
Text1.Visible = False
DTPicker1.Value = CDate(d)
End If
End SubPrivate Sub Form_Load()
Text1.Move DTPicker1.Left, DTPicker1.Top, DTPicker1.Width - 250, DTPicker1.Height
Text1.Visible = False
Text1.Text = ""
DTPicker1.UpDown = True
End Sub