本文介绍了任何人都可以帮助日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好 我想在我的应用程序中放入(Visual basic.net 2010)一个活动日历。 任何人都可以知道在哪里我找到了这个源代码。 提前谢谢Hi guysI want to put in my application (Visual basic.net 2010) an event Calendar.Can anyone know where I find source code for this.Thanks in advance推荐答案' objTextbox is a reference to either the' txtEffectiveDate TextBox or the txtExpirationDate TextBox.' It is set in Click Event HandlerDim objTextbox as TextboxDim bError_EffectiveDate as Boolean ' True when Effective Date is invalidDim bError_ExpirationDate as Boolean ' True when Expiration Date is invalid ''选择日期的事件'' Event for Date SelectedPrivate Sub MonthCalendar_DateSelected(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar.DateSelected bError_StartTime = False bError_StopTime = False objDateTextBox.Text = Format ''切换显示或隐藏MonthCalendar控件'' Toggle show or hide the MonthCalendar controlPrivate Sub ToggleCalendarButtons(ByVal TRUEFALSE As Boolean) MonthCalendar.Visible = Not TRUEFALSE If Not TRUEFALSE Then MonthCalendar.BringToFront() End If btnEffectiveDate.Enabled = TRUEFALSE btnExpirationDate.Enabled = TRUEFALSE btnOK.Enabled = TRUEFALSE Try MonthCalendar.SetDate(CDate(objDateTextBox.Text)) Catch End Try objDateTextBox.Focus()End Sub ''处理生效日期和到期日期按钮的点击事件'' Handle click event for Effective Date and Expiration Date buttonsPrivate Sub btnEffectiveDate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEffectiveDate.Click btnEffectiveDate.Enabled = False If Not MonthCalendar.Visible Then MonthCalendar.Location = New Point(btnEffectiveDate.Location.X, btnEffectiveDate.Location.Y) objDateTextBox = txtEffectiveDate Call ToggleCalendarButtons(False) End If btnEffectiveDate.Enabled = TrueEnd SubPrivate Sub btnExpirationDate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExpirationDate.Click btnExpirationDate.Enabled = False If Not MonthCalendar.Visible Then MonthCalendar.Location = New Point(btnExpirationDate.Location.X, btnExpirationDate.Location.Y) objDateTextBox = txtExpirationDate Call ToggleCalendarButtons(False) End If btnExpirationDate.Enabled = TrueEnd Sub ''验证日期以防万一使用键入它而不是从日历中选择'' Validate date in case use keyed it instead of selecting from the calendarPrivate Sub txtExpirationDate_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtExpirationDate.Validating If txtExpirationDate.Text.Length > 0 Then Try txtExpirationDate.Text = Format 这篇关于任何人都可以帮助日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!