473,320 Members | 1,993 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,320 software developers and data experts.

Calendar control question

Is it possible to highlight more than one date in the calendar control? I'm
trying to display a calendar to the user and highlight the dates that have
action items. Is this possible? Or is this control just for selecting dates?
Dec 24 '05 #1
1 1268
"DougS" <do**@nospam.com> wrote in message
news:4w****************@tornado.southeast.rr.com.. .
Is it possible to highlight more than one date in the calendar control?
I'm trying to display a calendar to the user and highlight the dates that
have action items. Is this possible? Or is this control just for selecting
dates?


You need to investigate the DayRender event, which fires once per day
displayed in the calendar control's current view. You work out which day it
is by the Day property of the DayRenderEventArgs parameter.

E.g. I maintain an online calendar for several bands, showing dates of
rehearsals, gigs etc. First I query SQL Server for any "events" which fall
between the beginning and end dates of the calendar's current view and read
them into an ArrayList. Then it's a simple matter to highlight any day on
which the band has an "event", as follows:

public void DayRender(object source, DayRenderEventArgs e)
{
if (arrDates.ContainsKey(e.Day.Date.ToString("dd MMM yyyy")) &&
!e.Day.IsOtherMonth)
{
Array arrStyle = arrDates[e.Day.Date.ToString("dd MMM
yyyy")].ToString().Split((Convert.ToChar(";")));
e.Cell.Font.Bold = true;
e.Cell.ForeColor =
System.Drawing.Color.FromName(arrStyle.GetValue(0) .ToString());
e.Cell.BackColor =
System.Drawing.Color.FromName(arrStyle.GetValue(1) .ToString());
}
}
Dec 24 '05 #2

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

Similar topics

0
by: Tim Graichen | last post by:
Hello, I am making use of the Active X calendar control (mscal.Calendar.7) in several places in my main form, with the following code Below is an example of the code I'm using for the...
8
by: Shyguy | last post by:
Is it possible to create a calendar that shows previous input data and also allows for input of new data?
5
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background...
1
by: Frank Bishop | last post by:
I have a user control that will open and close the calendar control when the user clicks on an anchor tag. Instead of having the user remember to close the calendar after they make a day selection,...
1
by: Peter | last post by:
I have a dilemna. Currently I have created a custom calendar webcontrol that a user can select and will dump the date along with some specialized information set in the tooltip. It actually is...
2
by: serge calderara | last post by:
Dear all, I have a webform with a calendar control on it. When loaded the calendar is set to the current date. Depending on a criteria from a database field, calendar day cell appears with red...
3
by: Peter | last post by:
Is there anyway to make the System.Web.UI.WebControls.Calendar to display only Month Name and Year, like: January, 2006 February, 2006 ..... .... .... ....
1
by: ajmera.puneet | last post by:
If I have Calendar Control on Asp.net page and I have a table for Fiscal years on sql server then, How can I check the dates from table to Calendar Control,so that I can format the Calendar...
2
by: Paul | last post by:
I am using the standard Calendar control in ASP.Net 2.0 and VB.Net and VS2005. Here is the code: <asp:calendar id="cldr_contract_date" runat="server" backcolor="#ffffff" width="250px"...
3
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.