Results 1 to 23 of 23

Thread: Calendar - Highlight some Days with different Colors

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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 ?

    Thanks,
    Rob C

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Re: Calendar - Highlight some Days with different Colors

    Use the DayBold property of the MonthView control (it's in one of the Microsoft Windows Common Controls libraries).
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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.
    Rob C

  4. #4
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Calendar - Highlight some Days with different Colors

    You can extend my control and add ToDo options. If I have the time I'll see what I can do for you this afternoon.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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.

    Thanks,
    Rob C

  6. #6
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Calendar - Highlight some Days with different Colors

    I've added a HotDates collection to the control, it allows you to select dates that have to be marked with a specific color.

    Looking over the project I realize that a little rewriting wouldn't hurt. A class-based approach would be easier to work with and maintain...

    Anyway, check it out. Do you need any other features? And before you ask, no it's not possible to make the hot dates bold or underlined...
    Attached Files Attached Files
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Calendar - Highlight some Days with different Colors

    Quote 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.

  8. #8
    Lively Member
    Join Date
    Oct 2001
    Posts
    105

    Re: Calendar - Highlight some Days with different Colors

    DBITech has a neat little control called CTDate that does just that.

    Sometimes it's worth to shell out a few bucks for something guaranteed to work, with tech support.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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 ?

    Thanks again,
    Rob C

  10. #10
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Calendar - Highlight some Days with different Colors

    sorry to hijack the thread, but is there a way to get text on a date?

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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 ?

    Hope I'm not 'looking a gift horse in the mouth'
    Rob C

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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.


    Joacim,
    Thanks for the info.
    Rob C

  13. #13
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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:
    1. Public Function Add( _
    2.  ByVal HotDate As Date, _
    3.  ByVal Message As String, _
    4.  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:
    VB Code:
    1. MonthView1.HotDates(MonthView1.DateValue).Color = RGB(127, 127, 127)
    This will also raise an error if you try to add a date as a hotdate if it already exist.

    You can now also use the For Each loop to loop through the HotDates.

    .
    Attached Files Attached Files
    Last edited by Joacim Andersson; Mar 23rd, 2005 at 09:08 PM.

  14. #14
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    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.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    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.

    Thanks again,
    Rob C

  16. #16
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Calendar - Highlight some Days with different Colors

    Quote 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).

  17. #17
    Lively Member
    Join Date
    Feb 2005
    Posts
    103

    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.

    Bret

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: Calendar - Highlight some Days with different Colors

    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

    Bret,
    Got a reply whilst I was sleeping -
    'Our components are not available for sale individually but rather as packages'
    And yup, $249
    Rob C

  19. #19
    Lively Member
    Join Date
    Feb 2005
    Posts
    103

    Re: Calendar - Highlight some Days with different Colors

    Bummer.
    Thanks,
    Bret

  20. #20
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Calendar - Highlight some Days with different Colors

    Quote 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!

  21. #21

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: Calendar - Highlight some Days with different Colors

    Thanks Joacim, I've downloaded it.
    But one couldn't tell from the 'number of views'
    Perhaps it's in the huff, because it was replaced ?
    Rob C

  22. #22
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Calendar - Highlight some Days with different Colors

    There's something bad with your control. The real MonthView control resize when you change the font size!

  23. #23
    New Member
    Join Date
    May 2005
    Posts
    5

    Re: Calendar - Highlight some Days with different Colors

    is it possible to implement this without having to write the whole monthview control?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width