Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How VB.NET uses MonthCalendar controls

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to use the MonthCalendar control VB.NET, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

VB.NET uses MonthCalendar controls

The following example shows how VB.NET uses the MonthCalendar control.

Locate the MonthCalendar control in the Toolbox under the common control (Common Controls) and add it to the window form (Window Form), and set the following properties:

◆ Name:mcDateSelection

◆ TodayDate: empty

◆ MaxSelectionCount:1

◆ Selection Range Start: empty

◆ Selection Range End: empty

Add the following code to the Form Load event:

McDateSelection.TodayDate = Now

Then create the events in list A. In this example, I set the MaxSelectionCount property to 1, which means that you can only select one of the MonthCalendar controls, not a set of dates. Select a date in the MonthView control

Private Sub mcDateSelection_DateSelected (ByVal sender As Object

ByVal e As System.Windows.Forms.DateRangeEventArgs)

Handles mcDateSelection.DateSelected

MessageBox.Show ("Calendar Today's Date:

"& mcDateSelection.TodayDate & vbCrLf & _"

Calendar Selected Start Date:

"& mcDateSelection.SelectionStart () & vbCrLf & _"

Calendar Selected End Date: "& mcDateSelection.SelectionEnd ())

End Sub

Since you can only choose a specific date in a month, rather than a set of dates, Selected Start Date and Selected End Date have the same values.

Now, set the MaxSelectionCount property to 7 and rerun the code. This time, you can choose a set of dates, and you can VB.NET to use many other properties and methods of the MonthCalendar control to meet your needs.

The above is all the content of the article "how to use MonthCalendar controls in VB.NET". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report