MonthCalendar Public Class Form11 Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e Handles MonthCalendar1.DateChanged 'selected date will display in Label Label2.Text = "Selected date is " + MonthCalendar1.SelectionRange.Start End Sub End Class Properties of MonthCalendar FirstDayOfWeek: Default value is Sunday. It means week starts with Sunday as the first day and Saturday as last. You can set the first day of the week depending upon your choice by selecting from the predefined list with this property. ShowToday: Default value is set to true which displays the current date at the bottom of the Calendar. When set it to False will hide current date. Private Sub Form11_Load(ByVal sender As System.Object, ByVal e As MyBase.Load 'Hide current date MonthCalendar1.ShowToday = False End Sub Imports System Imports System.Drawing Imports System.Windows.Forms Public NotInheritable Class Form1 Inherits System.Windows.Forms.Form Friend WithEvents MonthCalendar1 As System.Windows.Forms.MonthCalendar Friend WithEvents TextBox1 As System.Windows.Forms.TextBox <System.STAThread()> _ Public Shared Sub Main() System.Windows.Forms.Application.Run(New Form1) End Sub 'Main Public Sub New() MyBase.New() Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.TextBox1.Location = New System.Drawing.Point(48, 488) Me.TextBox1.Multiline = True Me.TextBox1.ReadOnly = True Me.TextBox1.Size = New System.Drawing.Size(824, 32) ' Create the calendar. Me.MonthCalendar1 = New System.Windows.Forms.MonthCalendar ' Set the calendar location. Me.MonthCalendar1.Location = New System.Drawing.Point(47, 16) ' Change the color. Me.MonthCalendar1.BackColor = System.Drawing.SystemColors.Info
MonthCalendar Public Class Form11 Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e Handles MonthCalendar1.DateChanged 'selected date will display in Label Label2.Text = "Selected date is " + MonthCalendar1.SelectionRange.Start End Sub End Class Properties of MonthCalendar FirstDayOfWeek: Default value is Sunday. It means week starts with Sunday as the first day and Saturday as last. You can set the first day of the week depending upon your choice by selecting from the predefined list with this property. ShowToday: Default value is set to true which displays the current date at the bottom of the Calendar. When set it to False will hide current date. Private Sub Form11_Load(ByVal sender As System.Object, ByVal e As MyBase.Load 'Hide current date MonthCalendar1.ShowToday = False End Sub Imports System Imports System.Drawing Imports System.Windows.Forms Public NotInheritable Class Form1 Inherits System.Windows.Forms.Form Friend WithEvents MonthCalendar1 As System.Windows.Forms.MonthCalendar Friend WithEvents TextBox1 As System.Windows.Forms.TextBox <System.STAThread()> _ Public Shared Sub Main() System.Windows.Forms.Application.Run(New Form1) End Sub 'Main Public Sub New() MyBase.New() Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.TextBox1.Location = New System.Drawing.Point(48, 488) Me.TextBox1.Multiline = True Me.TextBox1.ReadOnly = True Me.TextBox1.Size = New System.Drawing.Size(824, 32) ' Create the calendar. Me.MonthCalendar1 = New System.Windows.Forms.MonthCalendar ' Set the calendar location. Me.MonthCalendar1.Location = New System.Drawing.Point(47, 16) ' Change the color. Me.MonthCalendar1.BackColor = System.Drawing.SystemColors.Info
MonthCalendar.docx