简体   繁体   中英

custom control for large calendar

I'm starting from square one in trying to create a large calendar control. Most likely to take up the whole screen or something. It doesn't need to complex, just navigate to dates and display a line of text on specific days.

From researching this, sounds like I need to create my own custom control, which I have no idea how to do, moreover, how to achieve my objective.

Any insight?

Just finished a similar project here, you'll want to use DataGridView as your control first of all. Then create functions to control the population of data based on what month/year it is, including extraneous variables like leap year, etc.

So for a start, functions like:

UpdateDaysInMonth(): Determine how many days for Jan,Feb,Mar, etc

UpdateMonth(): Did the user click next month or previous month?

UpdateColumns(): This will be based on your preference, my calendar had days 1-31 all the way across, but if you're looking for a more traditional looking calendar it would be setup differently. For the days Sun-Sat, use the HeaderText for columns.

Once you have all the base data for what timeframe you're viewing, you can draw out the DataGridView.

Hope this helps, let me know if you have any more questions, and good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM