473,783 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14262
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**********@y ahoo.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*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread4.arco r-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**********@y ahoo.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_DayRe nder(object sender,
System.Web.UI.W ebControls.DayR enderEventArgs e)
{
foreach (DataRow row in ds.Tables["Calendar"].Rows){
try {
DateTime eventdate=(Date Time)row["event_start_ti me"];
if
(eventdate.ToSh ortDateString() .Equals(e.Day.D ate.ToShortDate String()))
{

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

----> e.Cell.BackColo r=System.Drawin g.Color.FromArg b(230,179,1); <--
}
}
catch
{
//if it can't do it, then so
be it
}
}
}
}

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

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

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
1863
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 MultiExtended SelectionMode for a listbox. IF not is there a freeware out there that does that? I know of www.infragistics.com www.datadynamics.com
13
3676
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 on, gets the focus, which is VERY annoying. Thanks, Steven
0
1374
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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As Form frm = New Form2 frm.Show()
8
2620
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 12:00:00 AM" How do I get the single day date?
1
3531
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 year (July-Dec) being rendered- depending on where todays date falls. I also want today's date to be selected. This poses a problem. Refer to the code below. Add a call to createCalendar() to your constructor (AFTER the InitializeComponents()...
2
5535
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 must use DateChanged and/or DateSelected events to get the new dates
0
1310
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 have reports. Is there some way that I can highlight certain days?
5
8733
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 along with selectionrange.start and .end would accomplish this, but it doesn't. Here is my code: Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles
11
7390
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 Month arrows (meaning they click on either of the left or right pointing arrows in the top corner). If the user changes the month, it messes up some of the date logic that I have in the DateChanged event. Does anybody know how I can capture this...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.