Calendar - Highlight some Days with different Colors
Hi,
I'm using VB6 and am looking for a User Control, or even just a VB Form, that can provide a visible calendar that readily indicates To Do's.
It would show any month, and indicate which days have something associated with them. Similar to what you see when you use Windows XP's System Restore (All the days that have a restore point available, are bold).
I would like to be able to control the color (backcolor) of the relevant dates.
EG Green for some, and Red for others that are urgent.
(I could live with having only forecolor selection.)
Is anyone aware of an example out there (or here), that permits that ?
Re: Calendar - Highlight some Days with different Colors
Thanks for suggestion, but I would prefer the extra highlighting that color can provide.
Plus being able to indicate there are ToDo's and Urgent ToDo's, is pretty essential.
Re: Calendar - Highlight some Days with different Colors
I have in the past, avoided using Controls (OCX's).
A few months back, I became aware that you could just include User Controls CTL's), in your VBP, and I love the concept.
I doubt that I have the knowledge to modify User Controls, so if you could do that I would really appreciate it.
Re: Calendar - Highlight some Days with different Colors
Originally Posted by RobCrombie
I have in the past, avoided using Controls (OCX's).
A few months back, I became aware that you could just include User Controls CTL's), in your VBP, and I love the concept.
I doubt that I have the knowledge to modify User Controls, so if you could do that I would really appreciate it.
Actually they are the same. The only different is that an OCX is a CTL that is compiled in it's own project. I haven't looked at TheVadars control but if it contains the source code you can simply add the CTL file (and anyother files) to your own porject and compile it into your EXE.
Re: Calendar - Highlight some Days with different Colors
Anyway, check it out. Do you need any other features?
Thanks for that. I am checking it out now.
Two quick questions -
- In Aust we 'use' ddmmyy will that cause any problems ?
- We start our weeks with Sun. Can your display be converted from Mon start ?
Re: Calendar - Highlight some Days with different Colors
Do you need any other features? And before you ask, no it's not possible to make the hot dates bold or underlined
In addition to Sunday on the left,
My dream is that user can clearly see which Dates are 'hot'.
To that end -
- Could the control(and fonts) be larger ?
- Could the dates flowing from previous and next month, not appear at all ?
My reason for asking is -
I can get reasonable emphasis on the hot days, by making the non-hot days a very faint grey. I then use black(or maybe darkish blue) for the normal 'hot' dates, and Red for the Urgent 'hot' dates.
Having the flow over dates from adjoining months visible, is sort of defeating my purpose, as I can't prevent them from being black (as far as my testing can tell ?)
I have worked out how to prevent today's date being emphasised.
I would also be switching off the display of the long today's date on the bottom.
That now leaves a white gap.
If you manage to suppress the adjoining months' dates, that will leave an even bigger gap.
Can they be removed ?
Re: Calendar - Highlight some Days with different Colors
sorry to hijack the thread, but is there a way to get text on a date?
|2eM!x,
The 'Hot' days feature has individual ToolTips, would that help you ?
DBITech has a neat little control called CTDate that does just that
simondeutsch,
That and the monthView look good.
The price is a lot more than 'a few bucks'.
I have asked them if the suite(6 controls) can be broken up into parts.
I'm guessiing if they say yes, it is going to be $US 80 each.
Re: Calendar - Highlight some Days with different Colors
I've made some changes to TheVaders month view control. I've added a FirstDayOfWeek property and a FillMonthView property. The latter (if set to True, the default) will show dates from previous and next month as before, but will hide them if it's set to False.
I've also changed the behaviour of the hotdates. First of all I've changed the signature of the Add method of the collection class. This however will break the code TheVader created! The new signature looks like this:
VB Code:
Public Function Add( _
ByVal HotDate As Date, _
ByVal Message As String, _
Optional ByVal Color As OLE_COLOR = vbRed) As cHotDate
As you can see I removed the ToolTip argument and replaced it with a Message argument instead. Message is also a new property of the cHotDate class. The ToolTip will automatically be created out of the first 127 characters of this property (replacing any new line or tab characters to spaces). I've also made the Color argument optional, it will use Red as the default (feel free to change that).
Other changes is that the date provided with the HotDates class is used as the key. So you can change a property of a hot date you've already added using this syntax:
Re: Calendar - Highlight some Days with different Colors
Nice additions, Joacim. I had just added the FillMonthview property when I came across your post. When I first wrote the control I also tried implementing the FirstDayOfWeek property (as you can see; StartOfWeek is a commented-out property), but for some reason I couldn't get it to work. Anyway, I'm glad it's included now.
Rob, the font size can be changed with the Font property. If you set it too large, however, the text will be larger than the labels. Resizing the control has been delibirately turned off since this is also the case with the original monthview control by Microsoft. To turn it on, code should be written to resize the text labels accordingly to the control.
Here, too, we use the DDMMYYYY format and it works fine, so there shouldn't be any problems with that.
Re: Calendar - Highlight some Days with different Colors
Thanks Joacim and TheVader,
The hide dates (un-FillMonthView) works great.
The First Day of the week (Sun) works great.
I didn't realise that i couldn't change the properties of an existing hot date, so that was much appreciated.
I had tried the font size change, and noticed it's effects. I ma...ay get brave enough to try resizing.
Re: Calendar - Highlight some Days with different Colors
Originally Posted by RobCrombie
I didn't realise that i couldn't change the properties of an existing hot date, so that was much appreciated.
Oh you could change the properties of an existing hot date before my changes. But you had to know which index it had. The first hot date you add will have index 1 the second 2 and so on (but the index changes if you remove a hot date). It's easier to be able to use the date instead. You can pass the date as a Date datatype or as a string (and you can of course still use the Index if you like).
Re: Calendar - Highlight some Days with different Colors
Did you hear back from DBI on purchasing their controls individually? I'm using their ctCal control and trying to convince myself to shell out the $250.
Re: Calendar - Highlight some Days with different Colors
Originally Posted by RobCrombie
Thanks for that Joacim. That will make it tons easier, and might guard against some idiot not realising that the index could change on him
Yeah.... OK... I've realised that I've actually added a couple of bugs... Well it's only one bug the other came from my statement on how you could change an item in the cHotKeys class.. That bug resided in the origional class . Anyway, I've changed the code and edited the above reply so if you've downloaded my code before you've read this you should download it again!!!!
Actually if you want to use it in a real app, you need to download it again.... No kidding... Do it!