473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Highlight days in MonthCalendar

Hi,

I am new to Windows Form programming and now have a simple Q about
MonthCalendar.

I want to hightlight some days in the calendar by changing the
background color of these days. But I can't find any property or
method that let me do this. What I know is that I can bold them...

Thanks.

Michael

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 15 '05 #1
3 14229
If you mean by MonthCalendar the DateTimePicker then the answer is no.

DateTimePicker is based on a DateTime Field in the Control.
This DateTime can have only one value.
The Date of the DateTime is highlighted.
Looking at DateTimePicker.cs offered by Microsoft show this as far as I can
see.

Sorry,
Mark Johnson, Berlin Germany
mj*****@mj10777.de

"michael_hk" <hk**********@yahoo.co-dot-jp.no-spam.invalid> schrieb im
Newsbeitrag news:3f**********@127.0.0.1...
Hi,

I am new to Windows Form programming and now have a simple Q about
MonthCalendar.

I want to hightlight some days in the calendar by changing the
background color of these days. But I can't find any property or
method that let me do this. What I know is that I can bold them...

Thanks.

Michael

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 15 '05 #2
I think by MonthCalendar he means MonthCalendar!

"Mark Johnson" <mj*****@mj10777.de> wrote in message
news:3f***********************@newsread4.arcor-online.net...
If you mean by MonthCalendar the DateTimePicker then the answer is no.

DateTimePicker is based on a DateTime Field in the Control.
This DateTime can have only one value.
The Date of the DateTime is highlighted.
Looking at DateTimePicker.cs offered by Microsoft show this as far as I can see.

Sorry,
Mark Johnson, Berlin Germany
mj*****@mj10777.de

"michael_hk" <hk**********@yahoo.co-dot-jp.no-spam.invalid> schrieb im
Newsbeitrag news:3f**********@127.0.0.1...
Hi,

I am new to Windows Form programming and now have a simple Q about
MonthCalendar.

I want to hightlight some days in the calendar by changing the
background color of these days. But I can't find any property or
method that let me do this. What I know is that I can bold them...

Thanks.

Michael

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption =---

Nov 15 '05 #3
bvh
Use the DayRender event for the calendar then target the days. Here
is some sample code that changes the background color of the cell if
there is a database entry for an appointment on any given day:

private void Calendar1_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
foreach (DataRow row in ds.Tables["Calendar"].Rows){
try {
DateTime eventdate=(DateTime)row["event_start_time"];
if
(eventdate.ToShortDateString().Equals(e.Day.Date.T oShortDateString()))
{

Here's what you want: e is coming of the DayRender method and gives
you a particular cell

----> e.Cell.BackColor=System.Drawing.Color.FromArgb(230 ,179,1); <--
}
}
catch
{
//if it can't do it, then so
be it
}
}
}
}

On 5 Jan 2004 21:10:27 -0600,
hk**********@yahoo.co-dot-jp.no-spam.invalid (michael_hk) wrote:
Hi,

I am new to Windows Form programming and now have a simple Q about
MonthCalendar.

I want to hightlight some days in the calendar by changing the
background color of these days. But I can't find any property or
method that let me do this. What I know is that I can bold them...

Thanks.

Michael

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


Nov 16 '05 #4

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

Similar topics

0
by: Irwin M. Fletcher | last post by:
Is there anyway to have the MonthCalendar control accept a selection of days that are not a range? Say 1/1/2003, 5/2/2003, and 5/23/2003. By holding down Ctrl, shift, etc. Similar to the...
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...
8
by: vbmark | last post by:
I want the MonthCalendar control to return the single day selected. I have MaxSelectionCount = 1. What I get back though is this: "SelectionRange: Start: 5/5/2005 12:00:00 AM, End: 5/5/2005...
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...
0
by: tomcarr1 | last post by:
I want to use the calendar control so that the user can click on a date and see a report for that date. However, there are not reports for every day, so I would like to highlight the days that...
5
by: Randy | last post by:
Based on the date that the user selects, I'm trying to make the MonthCalendar control highlight the entire week. In my case, the week is from Monday - Sunday. I thought that using AddBoldedDate...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.