Results 1 to 5 of 5

Thread: [RESOLVED] Bind to monthcalander

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    509

    Resolved [RESOLVED] Bind to monthcalander

    Hi

    If i have a monthcalender control on my form and i grab a recordset that includes dates, how can i get the dates to show on the month calender.

    Basically, just on a mobile phone, when you have a calender and you make a reminder, it highlights that date through a bold font.

    I am trying to achieve the same effect.

    I tried doing the following but it wouldn't work?

    Code:
    MonthCalendar1.DataBindings.Add("Date", ds.Tables(0), "Dated")
    Last edited by snipered; Apr 14th, 2007 at 05:41 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Bind to monthcalander

    Um, the MonthCalendar doesn't have a "Date" property. You're not going to be able to bind multiple dates like that. If you want to show multiple dates with a bold font then you create an array of Dates and you assign it to the BoldedDates property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    509

    Re: [02/03] Bind to monthcalander

    Ok, i'm trying this, but it doesnt seem to be working.

    When i pass the array to the bolded dates, it says:
    property must assign to the property or use it's value

    The type of my array is date and that's what is required to pass in boldeddates.

    Any ideas?

    Code:
            Dim arrays(2) As Date
    
    
            arrays(0) = "17/04/07"
            arrays(1) = "18/04/07"
            arrays(2) = "19/04/07"
    
            MonthCalendar1.BoldedDates(arrays)

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Bind to monthcalander

    BoldedDates is a property, not a method. You assign a value to a property, you don't pass it as a parameter:
    vb Code:
    1. MonthCalendar1.BoldedDates = arrays
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    509

    Re: [02/03] Bind to monthcalander

    Thanks for that. That worked a charm.

    Rep left.

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