Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to use Month Calendar Control in VB and C# (.net 2.0). Part 4

Author: Zunnair
Download Source Code : 891_window control.zip

In this simple article you will learn more about, that how can we use Month Calendar control in our application using VB and C# .net 2.0.

 

For good understanding read the first, second and third part of this article.
Remove Bolded Once Date:
In one of the previous articles we discussed that how we can bold a date which will remain bold in a specific month and day. Or you can say remain bold for that specific month in calendar. Now if we want to remove that bold date what we have to do. For this purpose month calendar control provides us a function named remove bolded date (). This function takes object of date and time class which has the bolded date and remove it from the calendar. This function remove the that bolded date which is stored in object.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_removeonce_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveBoldedDate(once);
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_removeonce_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveBoldedDate(once)
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes the bolded date.
Remove All Bolded Once Date:
Now if we want to remove the all once bolded dates what we have to do. For this purpose month calendar control provides us a function named remove all bolded dates (). This function takes no parameter and returns nothing. It removes all the once bolded dates.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_allonce_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveAllBoldedDates();
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_allonce_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveAllBoldedDates()
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes all the once bolded date.
Remove Monthly Bolded Date:
In one of the previous articles we also discussed that how we can bold a date which will remain bold in calendar every month. Now if we want to remove that bold date what we have to do. For this purpose month calendar control provides us a function named remove monthly bolded date (). This function takes object of date and time class which has the bolded date and remove it from the calendar. This function removes that bolded date which is stored in object.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_month_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveMonthlyBoldedDate(month);
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_month_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveMonthlyBoldedDate(month)
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes the monthly bolded date.
Remove All Monthly Bolded Date:
Now if we want to remove the all monthly bolded dates what we have to do. For this purpose month calendar control provides us a function named remove all monthly bolded dates (). This function takes no parameter and returns nothing. It removes all the monthly bolded dates.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_allmonth_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveAllMonthlyBoldedDates();
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_allmonth_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveAllMonthlyBoldedDates()
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes all the monthly bolded date.
Remove Annually Bolded Date:
In one of the previous articles we also discussed that how we can bold a date which will remain bold in specific month every year. Now if we want to remove that bold date what we have to do. For this purpose month calendar control provides us a function named remove annually bolded date (). This function takes object of date and time class which has the bolded date and remove it from the calendar. This function removes that bolded date which is stored in object.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_annual_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveAnnuallyBoldedDate(annually);
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_annual_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveAnnuallyBoldedDate(annually)
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes the annually bolded date.
Remove All Annually Bolded Date:
Now if we want to remove the all annually bolded dates what we have to do. For this purpose month calendar control provides us a function named remove all annually bolded dates (). This function takes no parameter and returns nothing. It removes all the annually bolded dates.
To demonstrate this make a window application drag month calendar control and one button. Press the button.
Now write the following code on button click event:
 C#
private void btn_allanually_Click(object sender, EventArgs e)
        {
            monthCalendar1.RemoveAllAnnuallyBoldedDates();
            MessageBox.Show("Bold Removed");
        }
VB
Private Sub btn_allanually_Click(ByVal sender As Object, ByVal e As EventArgs)
        monthCalendar1.RemoveAllAnnuallyBoldedDates();
        MessageBox.Show("Bold Removed")
    End Sub
This simple code removes all the annually bolded date.
Now write the following code on FORM LOAD event:
C#
private void Form1_Load(object sender, EventArgs e)
        {
            this.Text = "DEVASP Month Calendar APPLICATION";
monthCalendar1.FirstDayOfWeek = Day.Monday;
        }     
VB
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Me.Text = "DEVASP Month Calendar APPLICATION"
        monthCalendar1.FirstDayOfWeek = Day.Monday;   
End Sub
 
This simple article tells that how we can use Month Calendar control in our application using VB and C# .net 2.0.

 

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to use Month Calendar Control in VB and C# (.net 2.0). Part 3

Disclaimer - Privacy
© 2002-2017 DevASP.net