I have created a calendar that stores notes in dates, so you could click on any date you want and store text into it.

This is what my calendar looks like: https://www.youtube.com/watch?v=Rwnc-vqJd7w

Now I want to make my calendar highlight the dates with stored notes on it, so the user will know which dates have notes.

I named the calendar: MonthCalendar1


Sorry my English isn't that good ;p

10 years ago*

Comment has been collapsed.

Why you using Visual Studio 2010 instead 2013?

10 years ago
Permalink

Comment has been collapsed.

I don't know, please help :)

10 years ago
Permalink

Comment has been collapsed.

the real question would be: Why are you using Visual Basic and not C# ?

10 years ago
Permalink

Comment has been collapsed.

Or any other non-crappy language.

10 years ago
Permalink

Comment has been collapsed.

^This

10 years ago
Permalink

Comment has been collapsed.

I can't be sure that VS 2010 has it as I'm looking at the 2012 version, but it looks like the calendar has an array of DateTime objects called BoldedDates. Adding the dates you want to this array should cause them to appear in bold. This looks like the simplest way of highlighting dates that I could find with just a quick glance.

10 years ago
Permalink

Comment has been collapsed.

So how do I make it so every date that includes a note be bolder, without having to do them manually.

10 years ago
Permalink

Comment has been collapsed.

well, you have a (array or list) data structure where your notes are stored, just make a loop for this structure to perform that for every note.

10 years ago
Permalink

Comment has been collapsed.

You'll have to loop through the notes and add dates to MonthCalendar1.BoldedDates array. Take a look here

10 years ago
Permalink

Comment has been collapsed.

this

10 years ago
Permalink

Comment has been collapsed.

You might want to ask on stackoverflow instead.

10 years ago
Permalink

Comment has been collapsed.

I agree with the other guy, why not use .NET C#? A lot better than Visual basic even though it runs off .NET as well. +Stackoverflow is a better place.

10 years ago
Permalink

Comment has been collapsed.

Fuck, I do Visual Basic 2013 and I have never made a calender! I sure hope I master coding at least to get good results! I am not sure how good I am!

10 years ago
Permalink

Comment has been collapsed.

To be honest it is one crappy way to show your code. Posting it on pastebin or just attaching file with compressed solution would work better. Anyway - I use only C++, C# and a little javascript, so I'm not the best source of information. (I also haven't got the patience to look at 8+ minutes video of someone typing the code) But I would just create a new bool table. It would store information if the specific date has a note attached or not. You'll have to remember to set specific part of table to true each time someone sets up reminder and set to false when he deletes one.

When you display your calendar all you need to do is to ask in a loop 28 to 31 times (42 times if you'll include all the days from the weeks which began and ended that month) if eventExists[date] If true set font to Bold. Else - leave it normal. It will have a very small impact on the performance - even on raspberry PI or similar hardware.

For convenience reasons you may want it to be three dimensional table with day, month and year (if VB supports it - why the hell you decided to use it? I know that Basic was good in the ZX Spectrum era, but it was outdated in the 90's). Also the big advantage of this is the fact that if you'll want to rewrite the calendar or event database it will be possible to do so without messing up the code of the second part of program. Also it would speed up checks if the specific date got a note. (if you would like to add some reminders for the user) Bad part is that if you'll have two or more events in the same day, deleting one of them might make the second one invisible to the program (need to make a check for this while deleting notes - might have impact on the performance with big database if it is not well written - and probably you are a beginner and it will be poorly written - nothing to be ashamed of, just another thing on a list of things to learn)

And one more thing. Why Basic?

10 years ago
Permalink

Comment has been collapsed.

If you are going to start programming, you need to start aplying logic, and the logic says that there are better forums than this one for that... go to stackoverflow.com

10 years ago
Permalink

Comment has been collapsed.

Sign in through Steam to add a comment.