在 vb.net 中显示 mothcalander 控件中的月份?

show the month in mothcalander control in vb.net?

我有一个包含月份名称的列表视图。我有一个月历控件。我想知道这是否可行,然后我在列表视图中单击月份名称。它在 monthcalander 控件中显示月份名称?

Dim arr(3) As String
    Dim itm As ListViewItem
    arr(0) = "2015"
    arr(1) = "Jan"
    itm = New ListViewItem(arr)
    ListView1.Items.Add(itm)
    arr(0) = "2015"
    arr(1) = "feb"
    itm = New ListViewItem(arr)
    ListView1.Items.Add(itm)
    arr(0) = "2015"
    arr(1) = "Mar"
    itm = New ListViewItem(arr)
    ListView1.Items.Add(itm)
    arr(0) = "2015"
    arr(1) = "Apr"
    itm = New ListViewItem(arr)
    ListView1.Items.Add(itm)

在这部分中,我在文本框中获取月份名称。我想在日历控件中显示月份名称

  Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click
    Dim tt As String
    Dim tt1 As String
    tt = ListView1.SelectedItems.Item(0).SubItems(1).Text
    tt1 = ListView1.SelectedItems.Item(0).SubItems(0).Text
    TextBox1.Text = tt.ToString & vbCr & tt1
  End Sub

有什么建议吗?

将代码添加到 Listview 点击

Dim sr As New SelectionRange()
sr.Start = DateTime.Parse(Me.TextBox1.Text)
Me.MonthCalendar1.SelectionRange = sr