Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MonthCalendar.RemoveBoldedDate Method

Removes the specified date from the list of nonrecurring bolded dates.

[Visual Basic]
Public Sub RemoveBoldedDate( _
   ByVal date As DateTime _
)
[C#]
public void RemoveBoldedDate(
 DateTime date
);
[C++]
public: void RemoveBoldedDate(
 DateTime date
);
[JScript]
public function RemoveBoldedDate(
   date : DateTime
);

Parameters

date
The date to remove from the date list.

Remarks

If the specified date occurs more than once in the date list, then only the first date is removed. You must call UpdateBoldedDates to ensure that the display is updated to reflect the removal.

Example

[Visual Basic, C#, C++] The following example uses the RemoveBoldedDate method to remove a specified date from the list of bolded dates. This example assumes that a MonthCalendar control, named monthCalendar1, has been added to a Form and that this method is placed within the form and called from it.

[Visual Basic] 
Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
   monthCalendar1.RemoveBoldedDate(DateTime.Parse(listBox1.SelectedItem.ToString().Substring(0, listBox1.SelectedItem.ToString().IndexOf(" "))))
   monthCalendar1.UpdateBoldedDates()
   listBox1.Items.RemoveAt(listBox1.SelectedIndex)
   If listBox1.Items.Count = 0 Then
      button3.Enabled = False
   End If
End Sub 'button2_Click

[C#] 
private void button2_Click(object sender, System.EventArgs e)
{
    monthCalendar1.RemoveBoldedDate(DateTime.Parse(listBox1.SelectedItem.ToString().Substring(0,listBox1.SelectedItem.ToString().IndexOf(" "))));
    monthCalendar1.UpdateBoldedDates();
    listBox1.Items.RemoveAt(listBox1.SelectedIndex);
    if(listBox1.Items.Count == 0)
        button3.Enabled = false;
}

[C++] 
private:
   void button2_Click(Object* /*sender*/, System::EventArgs* /*e*/)
   {
      monthCalendar1->RemoveBoldedDate(DateTime::Parse(listBox1->SelectedItem->ToString()->Substring(0,listBox1->SelectedItem->ToString()->IndexOf(S" "))));
      monthCalendar1->UpdateBoldedDates();
      listBox1->Items->RemoveAt(listBox1->SelectedIndex);
      if(listBox1->Items->Count == 0)
         button3->Enabled = false;
   }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

MonthCalendar Class | MonthCalendar Members | System.Windows.Forms Namespace | UpdateBoldedDates

Show:
© 2015 Microsoft