|
Last week I made some promises about bringing an updated version of the control to the public. Even though it took me longer than I thought, and I was not able to implement everything that I wanted, there are still many changes, and progress has been made towards making this an ultimate bug-free control.
Ladies and gentlemen, without further ado I give you - Calendar DayView Control - Updated, available at http://gimlei.my-place.us
|
|
|
|
|
looks like you did all day events very good thanx for feedback.
i'll try to merge changes to codeplex when i have free time.
|
|
|
|
|
Thanks Ertan. I've sent you an e-mail, so if you want, we can discuss which of the changes should be merged and then give me write access so that I can do some of it a little later.
|
|
|
|
|
Great job Gimlei, i like your fixes a lot.
|
|
|
|
|
Thanks very much Andy. I hoped that my changed would come handy for many people. If you will be developing the control for your needs further and are able to spot/fix any bugs, or implement some of the features in the to-do list (or maybe some others!) and share it with us, that would be amazing.
|
|
|
|
|
Hi, i am in need of any update to this control exists. Unfortunately gimlei, your link is dead, so please could you post a working one or send me an email
vidas.vasiliauskas(eta)etalink.lt
I would be very happy and thankful to you.
Vidas Vasiliauskas
|
|
|
|
|
Hi all,
(Finally) I have created a project site on www.codeplex.com/calendar . To contribute the project please register to site and mail me (ertant@rdgnet.org) your user name for developer access rights.
Anonymous users still have access the project source but you have to register for changing the source.
|
|
|
|
|
Hi Batzo,
Thanks for the reply. Sorry that I wasn't clear on the point.
Below is a small section that I got stuck with an error pointing to the 'List groups = new List();' I followed everything you said, I don't know what is missing on my end.
============
AppointmentList appointments = (AppointmentList)cachedAppointments[time.Day];
if (appointments != null)
{
List groups = new List();
foreach (Appointment app in appointments)
{
if (!groups.Contains(app.Group))
groups.Add(app.Group);
app.refresh();
}
============
Thanks,
S.
|
|
|
|
|
Hi
I think error cause is another thing.
Please check another point. It may be that error cause is datasource that is is not found.
I will send email with attachment (sample project) later.
But, just now I can not send because It prohibits to send email from here.
I am sorry for I can not send sample project. I will send email later from another location.
|
|
|
|
|
I am having some trouble, you posted the code sample and I just replaced the entire thing. But then errors come up so I compared the one you posted to mine and there were chunks of code missing from yours.
I don't really get why but here is what I discovered was missing at the end...
internal int m_ConflictCount;
and other places that I can not pin point cause it would take too long. Is there away you can provide us all with your source of Appointment.cs and DayView.cs and maybe your modded code in Form1 cause I was also confused on where to put things.
It would be good if you could upload these files as a ZIP to Windows Live SkyDrive or something so we can see how you did it because I am getting many build errors.
Thanks,
Michael
P.S. If you would like it better, you can just send me the source or whatever through e-mail.
My email is TheFatPoliceMan[AT]gmail[DOTCOM]
|
|
|
|
|
how can i save all the Appointments in xml file(, for day | manth)?
sory4my english
oCcSkïng
|
|
|
|
|
Hello oCcSkïng.
You should use dataset. So, you can do it.
At the first, you should bind your Appointment with any dataset.
If you could data binding, you can save appointment into xml or any database table.
If you need sample code, I will give you.
-- modified at 2:08 Thursday 1st March, 2007
|
|
|
|
|
Hello batzo,
Yes, I would like to see the sample code. I have lots of problem saving it and display it on the control.
Thank you very much if you don't mind to show me some sample code.
S.
|
|
|
|
|
Hello,
Sorry for replying too late. At first, add new property named scheduleRow and new function named refresh into the Appoinment class and change the get/set methods little. Sample is here:
public class Appointment
{
private DataRow scheduleRow=null; //New property
public Appointment()
{
initialize();
}
public Appointment(DataRow dr)
{
scheduleRow = dr;
refresh();
}
private void initialize()
{
Color = Color.White;
BorderColor = Color.Blue;
Title = "New Appointment";
}
//new function
public void refresh()
{
if (scheduleRow == null)
return;
System.Drawing.ColorConverter colorConverter = new ColorConverter();
color = (Color)colorConverter.ConvertFromString(scheduleRow["Color"].ToString());
borderColor = (Color)colorConverter.ConvertFromString(scheduleRow["BorderColor"].ToString());
title = scheduleRow["Title"].ToString();
startDate = (DateTime)scheduleRow["StartDate"];
endDate = (DateTime)scheduleRow["EndDate"];
locked = System.Convert.ToBoolean(scheduleRow["Locked"].ToString());
}
private string group;
public string Group
{
get { return group; }
set { group = value; }
}
private DateTime startDate;
public DateTime StartDate
{
get
{
return startDate;
}
set
{
startDate = value;
OnStartDateChanged();
}
}
protected virtual void OnStartDateChanged()
{
if (scheduleRow != null)
{
scheduleRow["StartDate"] = StartDate;
}
}
private DateTime endDate;
public DateTime EndDate
{
get
{
return endDate;
}
set
{
endDate = value;
OnEndDateChanged();
}
}
protected virtual void OnEndDateChanged()
{
//System.Diagnostics.Debug.WriteLine("OnEndDateChanged: "+this.EndDate.ToString("yyyy-MM-dd HH:mm:ss"));
if (scheduleRow != null)
{
scheduleRow["EndDate"] = EndDate;
}
}
private bool locked = false;
[System.ComponentModel.DefaultValue(false)]
public bool Locked
{
get { return locked; }
set
{
locked = value;
OnLockedChanged();
}
}
protected virtual void OnLockedChanged()
{
if (scheduleRow != null)
{
scheduleRow["Locked"] = Locked.ToString();
}
}
private Color color = Color.White;
public Color Color
{
get
{
return color;
}
set
{
color = value;
OnColorChanged();
}
}
private void OnColorChanged()
{
if (scheduleRow != null)
{
System.Drawing.ColorConverter colorConverter = new ColorConverter();
scheduleRow["Color"] = colorConverter.ConvertToString(Color);
}
}
private Color textColor = Color.Black;
public Color TextColor
{
get { return textColor; }
set { textColor = value; }
}
private Color borderColor = Color.Blue;
public Color BorderColor
{
get
{
return borderColor;
}
set
{
borderColor = value;
OnBorderColorChanged();
}
}
private void OnBorderColorChanged()
{
if (scheduleRow != null)
{
System.Drawing.ColorConverter colorConverter = new ColorConverter();
scheduleRow["BorderColor"] = colorConverter.ConvertToString(BorderColor);
}
}
private string title = "";
[System.ComponentModel.DefaultValue("")]
public string Title
{
get
{
return title;
}
set
{
title = value;
OnTitleChanged();
}
}
protected virtual void OnTitleChanged()
{
//System.Diagnostics.Debug.WriteLine("OnTitleChanged: " + this.Title);
if (scheduleRow != null)
{
scheduleRow["Title"] = Title;
}
}
internal int conflictCount;
internal bool allDayEvent;
}
Then, you should change DayView Class as following code. (In DrawDay() function, call refresh() function of Appointment class)
private void DrawDay(PaintEventArgs e, Rectangle rect, DateTime time)
{
//renderer.DrawDayBackground(e.Graphics, rect);
Rectangle workingHoursRectangle = GetHourRangeRectangle(workStart, workEnd, rect);
if (workingHoursRectangle.Y < this.HeaderHeight)
workingHoursRectangle.Y = this.HeaderHeight;
if (!((time.DayOfWeek == DayOfWeek.Saturday) || (time.DayOfWeek == DayOfWeek.Sunday))) //weekends off -> no working hours
renderer.DrawHourRange(e.Graphics, workingHoursRectangle, false, false);
if ((selection == SelectionType.DateRange) && (time.Day == selectionStart.Day))
{
Rectangle selectionRectangle = GetHourRangeRectangle(selectionStart, selectionEnd, rect);
renderer.DrawHourRange(e.Graphics, selectionRectangle, false, true);
}
e.Graphics.SetClip(rect);
for (int hour = 0; hour < 24 * 2; hour++)
{
int y = rect.Top + (hour * halfHourHeight) - scrollbar.Value;
using (Pen pen = new Pen(((hour % 2) == 0 ? renderer.HourSeperatorColor : renderer.HalfHourSeperatorColor)))
e.Graphics.DrawLine(pen, rect.Left, y, rect.Right, y);
if (y > rect.Bottom)
break;
}
renderer.DrawDayGripper(e.Graphics, rect, appointmentGripWidth);
e.Graphics.ResetClip();
/* BEGIN */
AppointmentList appointments = (AppointmentList)cachedAppointments[time.Day];
if (appointments != null)
{
List<string> groups = new List<string>();
foreach (Appointment app in appointments)
{
if (!groups.Contains(app.Group))
groups.Add(app.Group);
app.refresh();
}
Rectangle rect2 = rect;
rect2.Width = rect2.Width / groups.Count;
groups.Sort();
foreach (string group in groups)
{
DrawAppointments(e, rect2, time, group);
rect2.X += rect2.Width;
}
}
/* END */
}
Next, Add new property into the container of DayView control. For example: Form1 class.
partial class Form1
{
private System.Data.DataSet scheduleDataSet;
......
.....
}
Now, you should get data from Database or xml file. I wrote some functions you need.
private void CreateTable()
{
this.scheduleDataSet = new System.Data.DataSet();
System.Data.DataTable scheduleDataTable = new System.Data.DataTable();
System.Data.DataColumn TitleColumn = new System.Data.DataColumn();
System.Data.DataColumn StartDateColumn = new System.Data.DataColumn();
System.Data.DataColumn EndDateColumn = new System.Data.DataColumn();
System.Data.DataColumn BorderColorColumn = new System.Data.DataColumn();
System.Data.DataColumn ColorColumn = new System.Data.DataColumn();
System.Data.DataColumn LockedColumn = new System.Data.DataColumn();
//
// scheduleDataSet
//
this.scheduleDataSet.DataSetName = "scheduleDataSet";
this.scheduleDataSet.Tables.AddRange(new System.Data.DataTable[] {
scheduleDataTable});
//
// scheduleDataTable
//
scheduleDataTable.Columns.AddRange(new System.Data.DataColumn[] {
TitleColumn,
StartDateColumn,
EndDateColumn,
BorderColorColumn,
ColorColumn,
LockedColumn});
scheduleDataTable.TableName = "schedule";
//
// TitleColumn
//
TitleColumn.ColumnName = "Title";
//
// StartDateColumn
//
StartDateColumn.ColumnName = "StartDate";
StartDateColumn.DataType = typeof(System.DateTime);
//
// EndDateColumn
//
EndDateColumn.ColumnName = "EndDate";
EndDateColumn.DataType = typeof(System.DateTime);
//
// BorderColorColumn
//
BorderColorColumn.ColumnName = "BorderColor";
//
// ColorColumn
//
ColorColumn.ColumnName = "Color";
//
// LockedColumn
//
LockedColumn.ColumnName = "Locked";
}
private void createData()
{
CreateTable();
System.Data.DataRow dr = scheduleDataSet.Tables["schedule"].NewRow();
DateTime dateTime = DateTime.Now;
dr["Title"] = "Appointment1 (Purevsuren)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddMinutes(15);
dr["Color"] = "White";
dr["BorderColor"] = "Blue";
dr["Locked"] = "false";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddMinutes(30);
dr["Title"] = "Appointment2 (Zorigt)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddMinutes(30);
dr["Color"] = "White";
dr["BorderColor"] = "Blue";
dr["Locked"] = "false";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddHours(3);
dr["Title"] = "Appointment3 (Batzorigt)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddHours(1);
dr["Color"] = "Red";
dr["BorderColor"] = "Blue";
dr["Locked"] = "true";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddHours(3);
dr["Title"] = "Flying to Mongolia";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddHours(1);
dr["Color"] = "Red";
dr["BorderColor"] = "Blue";
dr["Locked"] = "true";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
writeToXml("schedule.xml");
}
private void readFromXml(String fileName)
{
//add your own code here
scheduleDataSet.ReadXml(fileName);
}
private void writeToXml(String fileName)
{
//add your own code here
scheduleDataSet.WriteXml(fileName);
}
In constructor function I added some code to display data that read from xml file.
PS: I inserted the DataGridView1 and Save button into the form.
private void initDayView()
{
m_Appointments = new List<appointment>();
for (int i = 0; i < scheduleDataSet.Tables["schedule"].Rows.Count; i++)
{
Appointment app = new Appointment(scheduleDataSet.Tables["schedule"].Rows[i]);
m_Appointments.Add(app);
}
}
public Form1()
{
InitializeComponent();
//if there is no xml file, create xml file
createData(); //else comment out this line
//read from xml file
//readFromXml("schedule.xml"); //if there is xml file
this.dataGridView1.DataSource = scheduleDataSet;
this.dataGridView1.DataMember = "schedule";
initDayView();
dayView1.StartDate = DateTime.Now;
dayView1.NewAppointment += new NewAppointmentEventHandler(dayView1_NewAppointment);
dayView1.SelectionChanged += new EventHandler(dayView1_SelectionChanged);
dayView1.ResolveAppointments += new Calendar.ResolveAppointmentsEventHandler(this.dayView1_ResolveAppointments);
dayView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.dayView1_MouseMove);
comboBox1.SelectedIndex = 1;
}
To save data into xml file on click of Save button:
private void btnSave_Click(object sender, EventArgs e)
{
scheduleDataSet.WriteXml("schedule.xml");
}
If you wish to update DayView control on changing of datagrid, you should add CellEndEdit event.
So, you can use following code:
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
dayView1.Invalidate();
}
Good Luck!
-- modified at 4:58 Monday 5th March, 2007
|
|
|
|
|
Hi Batzo,
Thank you very much. You really light up something for me. I will do as you said. I will let you know of my progress.
Can I communication with you thru my peronsal email (qdata@yahoo.com)? Becuase I would like to ask you more questions if you don't mind.
Thanks again.
S.
|
|
|
|
|
Hi Batzo,
Sorry to borrow you again, but I think there is something missing between the BEGIN and END clause in the sample code. Can you please check let me know what I am missing?
Thanks,
S.
|
|
|
|
|
Hi.
If you write more clearly, I will help you. Please write new message with code snippets.
/* BEGIN */
AppointmentList appointments = (AppointmentList)cachedAppointments[time.Day];
if (appointments != null)
{
List<string> groups = new List<string>();
foreach (Appointment app in appointments)
{
if (!groups.Contains(app.Group))
groups.Add(app.Group);
app.refresh();
}
Rectangle rect2 = rect;
rect2.Width = rect2.Width / groups.Count;
groups.Sort();
foreach (string group in groups)
{
DrawAppointments(e, rect2, time, group);
rect2.X += rect2.Width;
}
}
/* END */
I missed somethings:
private void btnSave_Click(object sender, EventArgs e)
{
this.writeToXmlSchema("scheduleDataSet.xsd");
this.writeToXml("schedule.xml");
}
public Form1()
{
InitializeComponent();
this.scheduleDataSet = new System.Data.DataSet();
//if there is no xml file, create xml file
createData(); //else comment out this line
//read from xml file
//readFromXmlSchema("scheduleDataSet.xsd"); //if there is xsd file
//readFromXml("schedule.xml"); //if there is xml file
this.dataGridView1.DataSource = scheduleDataSet;
this.dataGridView1.DataMember = "schedule";
initDayView();
dayView1.StartDate = DateTime.Now;
dayView1.NewAppointment += new NewAppointmentEventHandler(dayView1_NewAppointment);
dayView1.SelectionChanged += new EventHandler(dayView1_SelectionChanged);
dayView1.ResolveAppointments += new Calendar.ResolveAppointmentsEventHandler(this.dayView1_ResolveAppointments);
dayView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.dayView1_MouseMove);
comboBox1.SelectedIndex = 1;
}
private void readFromXmlSchema(String fileName)
{
//add your own code here
scheduleDataSet.ReadXmlSchema(fileName);
}
private void writeToXmlSchema(String fileName)
{
scheduleDataSet.WriteXmlSchema(fileName);
}
private void createData()
{
CreateTable();
System.Data.DataRow dr = scheduleDataSet.Tables["schedule"].NewRow();
DateTime dateTime = DateTime.Now;
dr["Title"] = "Appointment1 (Purevsuren)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddMinutes(15);
dr["Color"] = "White";
dr["BorderColor"] = "Blue";
dr["Locked"] = "false";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddMinutes(30);
dr["Title"] = "Appointment2 (Zorigt)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddMinutes(30);
dr["Color"] = "White";
dr["BorderColor"] = "Blue";
dr["Locked"] = "false";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddHours(3);
dr["Title"] = "Appointment3 (Batzorigt)";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddHours(1);
dr["Color"] = "Red";
dr["BorderColor"] = "Blue";
dr["Locked"] = "true";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
dr = scheduleDataSet.Tables["schedule"].NewRow();
dateTime = dateTime.AddHours(3);
dr["Title"] = "Flying to Mongolia";
dr["StartDate"] = dateTime;
dr["EndDate"] = dateTime.AddHours(1);
dr["Color"] = "Red";
dr["BorderColor"] = "Blue";
dr["Locked"] = "true";
scheduleDataSet.Tables["schedule"].Rows.Add(dr);
}
|
|
|
|
|
hi!
can you help me?
i want to try this program but i has mistake.can you tell me where define
List group = new List();
DrawAppointments(e, rect2, time, group);
we dont have function for 4 arguments.
help me.
|
|
|
|
|
Looks really great!
Just wondering if the latest version here includes all the suggested changes and bug-fixes below in this forum?
Keep up the nice work!
Would you care publishing this on the Codeplex? In that way it may even develop further.
/M
|
|
|
|
|
Basically, the answer is no, it doesn't.
I am currently working on a version of the control which does integrate almost all of the changes and bugfixes, and in addition has full support for multiple-day events. It will be published here in comments in a few days time, maybe over the weekend.
Regards,
Gimlei
|
|
|
|
|
Great! Looking forward to that.
Until then I can use the current version.
/M
|
|
|
|
|
Gimlei wrote: I am currently working on a version of the control which does integrate almost all of the changes and bugfixes, and in addition has full support for multiple-day events. It will be published here in comments in a few days time, maybe over the weekend.
You are awesome Gimlei!
I haven't been able to put more time into this project like I had hoped.
I think all these changes and bugfixes sure make an already really good control even so much better. I look forward to seeing your fixes.
Andrew
|
|
|
|
|
Hi Gimlei,
I am excited to hear that you have an update version. This is a great control.
I have problem with loading the data from a database into the control. Can you give me some hint or a small piece of sample that will help me a lot.
Thanks a lot
Sam
|
|
|
|
|
Step 1.
Add an icon property to the appointment class. You may wan't a default icon or test for null in the draw appointment method.
private Icon m_icon;<br />
<br />
public Icon Icon<br />
{<br />
get { return m_icon; }<br />
set { m_icon = value; }<br />
}
Step 2.
Modify the DrawAppointment method in the render class (here is the Office12 renderer code). My icons are 24 x 24, so change code as needed for larger or smaller icons.
public override void DrawAppointment(System.Drawing.Graphics g, System.Drawing.Rectangle rect, Appointment appointment, bool isSelected, int gripWidth)<br />
{<br />
StringFormat m_Format = new StringFormat();<br />
m_Format.Alignment = StringAlignment.Near;<br />
m_Format.LineAlignment = StringAlignment.Near;<br />
m_Format.Trimming = StringTrimming.EllipsisWord;<br />
Icon icon = appointment.Icon;<br />
<br />
Color start = InterpolateColors(appointment.Color, Color.White, 0.4f);<br />
Color end = InterpolateColors(appointment.Color, Color.FromArgb(191, 210, 234), 0.7f);<br />
<br />
if ((appointment.Locked))<br />
{<br />
using (Brush m_Brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.LargeConfetti, Color.Blue, appointment.Color))<br />
g.FillRectangle(m_Brush, rect);<br />
<br />
start = Color.FromArgb(230, start);<br />
end = Color.FromArgb(180, end);<br />
<br />
GraphicsPath path = new GraphicsPath();<br />
path.AddRectangle(rect);<br />
<br />
using (LinearGradientBrush aGB = new LinearGradientBrush(rect, start, end, LinearGradientMode.Vertical))<br />
g.FillRectangle(aGB, rect);<br />
}<br />
else<br />
{<br />
using (LinearGradientBrush aGB = new LinearGradientBrush(rect, start, end, LinearGradientMode.Vertical))<br />
g.FillRectangle(aGB, rect);<br />
}<br />
<br />
if (isSelected)<br />
{<br />
Rectangle m_BorderRectangle = rect;<br />
<br />
using (Pen m_Pen = new Pen(appointment.BorderColor, 4))<br />
g.DrawRectangle(m_Pen, rect);<br />
<br />
m_BorderRectangle.Inflate(2, 2);<br />
<br />
using (Pen m_Pen = new Pen(SystemColors.WindowFrame, 1))<br />
g.DrawRectangle(m_Pen, m_BorderRectangle);<br />
<br />
m_BorderRectangle.Inflate(-4, -4);<br />
<br />
using (Pen m_Pen = new Pen(SystemColors.WindowFrame, 1))<br />
g.DrawRectangle(m_Pen, m_BorderRectangle);<br />
}<br />
else<br />
{<br />
Rectangle m_GripRectangle = rect;<br />
<br />
m_GripRectangle.Width = gripWidth + 1;<br />
<br />
start = InterpolateColors(appointment.BorderColor, appointment.Color, 0.2f);<br />
end = InterpolateColors(appointment.BorderColor, Color.White, 0.6f);<br />
<br />
using (LinearGradientBrush aGB = new LinearGradientBrush(rect, start, end, LinearGradientMode.Vertical))<br />
g.FillRectangle(aGB, m_GripRectangle);<br />
<br />
using (Pen m_Pen = new Pen(SystemColors.WindowFrame, 1))<br />
g.DrawRectangle(m_Pen, rect);<br />
<br />
int xLeft = rect.X + 6;<br />
int xRight = rect.Right + 1;<br />
int yTop = rect.Y + 1;<br />
int yButton = rect.Bottom + 1;<br />
<br />
for (int i = 0; i < 5; i++)<br />
{<br />
using (Pen shadow_Pen = new Pen(Color.FromArgb(70 - 12 * i, Color.Black)))<br />
{<br />
g.DrawLine(shadow_Pen, xLeft + i, yButton + i, xRight + i - 1, yButton + i);
g.DrawLine(shadow_Pen, xRight + i, yTop + i, xRight + i, yButton + i);
}<br />
}<br />
<br />
}<br />
<br />
<br />
rect.X += gripWidth;<br />
rect.Width = rect.Width - 24;<br />
rect.X = rect.X + 24;<br />
g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;<br />
g.DrawString(appointment.Title, this.BaseFont, SystemBrushes.WindowText, rect, m_Format);<br />
rect.X = rect.X - 24;<br />
if (rect.Width > 24 && rect.Height > 24)<br />
{<br />
g.DrawIcon(icon, rect.Left, rect.Top);<br />
}<br />
g.TextRenderingHint = TextRenderingHint.SystemDefault;<br />
<br />
}
Step 3.
Add some icons to your project set their property to "copy to output directory" when building (you'll find this under the properties sheet of the icon).
When creating an appointment, define the Appointment.Icon property value.
m_App.Icon = new Icon(".\\Icons\\myicon.ico");
Tha't about it. Good luck!
-- modified at 20:29 Thursday 22nd February, 2007
|
|
|
|
|
Excellent code, pracsec!
Thanks a lot, I was about to embark on adding this functionality to the control, but you were there first. Thanks again!
|
|
|
|
|