473,739 Members | 6,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1289
"DougS" <do**@nospam.co m> wrote in message
news:4w******** ********@tornad o.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 DayRenderEventA rgs 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(objec t source, DayRenderEventA rgs e)
{
if (arrDates.Conta insKey(e.Day.Da te.ToString("dd MMM yyyy")) &&
!e.Day.IsOtherM onth)
{
Array arrStyle = arrDates[e.Day.Date.ToSt ring("dd MMM
yyyy")].ToString().Spl it((Convert.ToC har(";")));
e.Cell.Font.Bol d = true;
e.Cell.ForeColo r =
System.Drawing. Color.FromName( arrStyle.GetVal ue(0).ToString( ));
e.Cell.BackColo r =
System.Drawing. Color.FromName( arrStyle.GetVal ue(1).ToString( ));
}
}
Dec 24 '05 #2

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

Similar topics

0
3671
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 controls. Private Sub DateSold_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) SoldCal.Visible = True
8
2458
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
4599
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 Color 3. Foreground Color 4. Border Tickness 5. Border Color
1
339
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, I would like the calendar to close itself after the day selection. I'm using the day selected to feed a text box (code not shown here). Here is my user control code and HTML - Help appreciated - Frank: <code> ' User Control Code.........
1
2270
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 working great. However I am having the same second thoughts about the control as everyone else because of all the real estate it takes up so I would like to add a button to alternately hide/display the calendar control. The only problem is that if I...
2
1905
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 background color for the selected month. This is done by using the Calendar_DayRender event. This works fine What I need to do next is that if my user click on either the NextMonth or PrevMonth, I should get the same behaviour for day cells...
3
850
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
2231
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 control cells according to my need. I want to change the color of Dates according to fiscal month. i.e. As Calendar control has dates for Current + next + Previous months, I need to change the color of dates of month which is comes under Fiscal...
2
4133
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" height="200px" font-size="12px" font-names="Arial" borderwidth="2px" bordercolor="#000000" nextprevformat="shortmonth" daynameformat="firsttwoletters" OnSelectionChanged="cldr_SelectionChanged"> <titlestyle font-size="14px" font-bold="true"...
3
2740
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 assist with this. Thanks in advance. I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000.
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
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...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
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
6754
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
6054
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
4570
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
3280
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
3
2193
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.