473,465 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Customize the Microsoft MonthCalendar

Hi !

Someone could help me to know how to customize the MonthCalendar in
..NET 2.0 ? I would like to be able to change the color of every day in
a month...

Does Microsoft has released the code of this component ?

Thanks !

Martin

Aug 10 '06 #1
4 4409
Martin,

MS doesn't really release code like that. Additionally, what you see in
..NET is most likely a wrapper around unmanaged code, so you wouldn't be able
to look at it through say, Reflector and see how to do what it does.

The only extensibility points that are available are the ones available
through the .NET wrapper for the control, and whatever might be offered
through unmanaged APIs. You should look at the MSDN documentation for this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Martin" <ma*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi !

Someone could help me to know how to customize the MonthCalendar in
.NET 2.0 ? I would like to be able to change the color of every day in
a month...

Does Microsoft has released the code of this component ?

Thanks !

Martin

Aug 10 '06 #2
You can give any day, any color you like. For instance create a web page.
Drag a Calendar control on it. In the code behind do the following:

using System;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebCalendar
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : Page
{
protected Calendar Calendar1;

private void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay day = e.Day;
if (IsMyBirthDay(day.Date ))
{
e.Cell.BackColor = Color.Red;
}
}

private bool IsMyBirthDay(DateTime date)
{
if (date.Day == 23 && date.Month == 8)
return true;

return false;
}
}
}

This worked already in VS 2003 by the way

Cheers,
Rick.
"Martin" wrote:
Hi !

Someone could help me to know how to customize the MonthCalendar in
..NET 2.0 ? I would like to be able to change the color of every day in
a month...

Does Microsoft has released the code of this component ?

Thanks !

Martin

Aug 13 '06 #3
This is an ASP.NET component. I am looking for a WinForm component.

Rick wrote:
You can give any day, any color you like. For instance create a web page.
Drag a Calendar control on it. In the code behind do the following:

using System;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebCalendar
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : Page
{
protected Calendar Calendar1;

private void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay day = e.Day;
if (IsMyBirthDay(day.Date ))
{
e.Cell.BackColor = Color.Red;
}
}

private bool IsMyBirthDay(DateTime date)
{
if (date.Day == 23 && date.Month == 8)
return true;

return false;
}
}
}

This worked already in VS 2003 by the way

Cheers,
Rick.
"Martin" wrote:
Hi !

Someone could help me to know how to customize the MonthCalendar in
..NET 2.0 ? I would like to be able to change the color of every day in
a month...

Does Microsoft has released the code of this component ?

Thanks !

Martin
Aug 15 '06 #4
This article seems to be what you want...

Cheers,
Rick

http://nickeandersson.blogs.com/blog...ying_the_.html

"Martin" wrote:
This is an ASP.NET component. I am looking for a WinForm component.

Rick wrote:
You can give any day, any color you like. For instance create a web page.
Drag a Calendar control on it. In the code behind do the following:

using System;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebCalendar
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : Page
{
protected Calendar Calendar1;

private void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay day = e.Day;
if (IsMyBirthDay(day.Date ))
{
e.Cell.BackColor = Color.Red;
}
}

private bool IsMyBirthDay(DateTime date)
{
if (date.Day == 23 && date.Month == 8)
return true;

return false;
}
}
}

This worked already in VS 2003 by the way

Cheers,
Rick.
"Martin" wrote:
Hi !
>
Someone could help me to know how to customize the MonthCalendar in
..NET 2.0 ? I would like to be able to change the color of every day in
a month...
>
Does Microsoft has released the code of this component ?
>
Thanks !
>
Martin
>
>

Aug 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: anthonytjea | last post by:
Hi all, Iam trying to embed the well known Month Calendar found at http://www.lebans.com/monthcalendar.htm directly into an MS Access form the same way that the ActiveX Calendar Control is...
2
by: Steven | last post by:
Hello, I have an application with multiple forms. One of the forms contains a monthcalendar. Each 2 minutes, the monthcalendar is getting the focus. I don't know why, it seems like this happens...
13
by: steven | last post by:
A monthcalendar checks every 2 minutes if theres a new day. Does anyone knows how to disable this ? The problem is that, everytime a monthcalendar checks this, the form where the monhcalendar is...
0
by: steven | last post by:
Start a new project with 2 forms: one with a datagrid, a button and a monthcalendar, and another form without controls. Try this code in your form with the monthcalendar: Private Sub...
3
by: RG | last post by:
For a Windows project in VB.NET 2003: I need a Calendar that’s much larger than the MonthCalendar control in the toolbox; it needs to fill the whole screen (at least approximately ). VB...
1
by: DS | last post by:
I seem to have run into another strange anomaly with the monthCalendar control. I want to display 6 months at time with either the first half of the year (January-June) or the later half of the...
2
by: meska | last post by:
Hi all, Scenario: I have a MonthCalendar control, and DataGridView. Depending on dates displayed in MonthCalendar I want to update information from database. The Possible Solution: So I...
11
by: Randy | last post by:
I have a MonthCalendar on one of my forms. I have disovered that the DateChanged event is triggered not only when the user clicks on a new date, but also if they click on the Previous or Next...
2
by: SePp | last post by:
Hi there, I have a WindowsForm which includes a label. I want to add a date to this label which a user can select. I thought it is probably the best to open another WindowsForm and to add on...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.