Results 1 to 4 of 4

Thread: [2005] Month Calendar bolded dates

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    8

    [2005] Month Calendar bolded dates

    I hope this isn't a re-post, I searched but couldn't find anything specifically.

    What I would like to do is to bold a date that the user selects.
    So, in the MonthCalendar1.DateSelected event I add the selected date (e.start) to the bolded array:

    MonthCalendar1.AddBoldedDate(e.Start)

    This works fine in that it adds the date to the bolded array.

    But.

    It doesn't display it as bolded.
    (I have tried refreshing the calendar, but this didn't work either).

    Does anyone know how to get it to display the bolded dates?

    --Mike

  2. #2
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: [2005] Month Calendar bolded dates

    You need to run UpdateBoldedDates after any changes

    MonthCalendar1.UpdateBoldedDates()

    Casey.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    8

    Re: [2005] Month Calendar bolded dates

    Thanks Casey,
    works great!
    (Don't know why I didn't notice that method!)

    --Mike

  4. #4
    New Member
    Join Date
    May 2015
    Posts
    1

    Unhappy Re: [2005] Month Calendar bolded dates

    Quote Originally Posted by vbasicgirl View Post
    You need to run UpdateBoldedDates after any changes

    MonthCalendar1.UpdateBoldedDates()

    Casey.
    Hi I am having a problem with my code. Everytime I pass through this line

    Code:
    mocScheduler.UpdateBoldedDates()
    An error message occurs like this:

    Code:
    An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
    
    Additional information: Operation is not valid due to the current state of the object.
    
    If there is a handler for this exception, the program may be safely continued.
    Here is the complete code:

    Code:
            Dim vstrChoice2 As String
            If chkWaitingForResponse.Checked = True Then
                vstrChoice2 = "SELECT Format(Date_Planned, 'MM/dd/yyyy') FROM (ACTIONS LEFT JOIN NEEDS ON ACTIONS.Need_ID = NEEDS.Need_ID) LEFT JOIN PERSONAL_DETAILS ON NEEDS.Client_ID = PERSONAL_DETAILS.Personal_DetailID WHERE Month(Date_Planned) = Month(#" & lblCalendar.Text & "#) AND Year(Date_Planned) = Year(#" & lblCalendar.Text & "#) AND PERSONAL_DETAILS.Income <> '6-STANDBY' AND ACTIONS.Date_Executed IS NULL GROUP BY Format(Date_Planned, 'MM/dd/yyyy')" & _
                                                  " UNION " & _
                                                  "SELECT Format(Date_Executed, 'MM/dd/yyyy') FROM (ACTIONS LEFT JOIN NEEDS ON ACTIONS.Need_ID = NEEDS.Need_ID) LEFT JOIN PERSONAL_DETAILS ON NEEDS.Client_ID = PERSONAL_DETAILS.Personal_DetailID WHERE Month(Date_Executed) = Month(#" & lblCalendar.Text & "#) AND Year(Date_Executed) = Year(#" & lblCalendar.Text & "#) AND PERSONAL_DETAILS.Income <> '6-STANDBY' AND ACTIONS.Client_Response = '[Waiting For Response]' GROUP BY Format(Date_Executed, 'MM/dd/yyyy')"
            Else
                vstrChoice2 = "SELECT Format(Date_Planned, 'MM/dd/yyyy') FROM (ACTIONS LEFT JOIN NEEDS ON ACTIONS.Need_ID = NEEDS.Need_ID) LEFT JOIN PERSONAL_DETAILS ON NEEDS.Client_ID = PERSONAL_DETAILS.Personal_DetailID WHERE Month(Date_Planned) = Month(#" & lblCalendar.Text & "#) AND Year(Date_Planned) = Year(#" & lblCalendar.Text & "#) AND PERSONAL_DETAILS.Income <> '6-STANDBY' AND ACTIONS.Date_Executed IS NULL GROUP BY Format(Date_Planned, 'MM/dd/yyyy')"
            End If
    
            Dim da2 As New OleDb.OleDbDataAdapter(vstrChoice2, cnn)
            Dim dt2 As New DataTable
            da2.Fill(dt2)
    
            mocScheduler.RemoveAllBoldedDates()
    
            If dt2.Rows.Count > 0 Then
                For i As Long = 0 To dt2.Rows.Count - 1
                    Call ADDBOLD(Year(dt2.Rows(i).Item(0)), Month(dt2.Rows(i).Item(0)), DatePart(DateInterval.Day, dt2.Rows(i).Item(0)))
                Next
            End If
    
    
            mocScheduler.UpdateBoldedDates()
    Please help me. I am no a programmer but I am self studying how to be one.

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