 |
|
|
 |
 |
|
จะให้เขียนให้ต้องมาอะไรมาแลกเปลี่ยนครับ
งั้นขอ algoritm ก่อน ไปคิดมาซะดีๆ
|
 |
 |
 |
 |
Date :
2010-03-18 08:35:09 |
By :
tungman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จะเอาอัลกอเพื่อ ?? คะ ก็แค่ทำ month calendar ให้เป็นไฮไลวันที่มีงานสมมุติว่า วันที่สี่มีงานก็มีไฮไลเป็นสีแดงที่วันที่สี่แค่นี้อะคะ เคยลอง dayrender แล้วมันไม่ได้อะคะ รบกวนด้วยนะคะ
|
 |
 |
 |
 |
Date :
2010-03-19 20:15:56 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เพื่อให้เจ้าได้ทำเองไง งั้นไม่เอา algoritm ก็ได้ แต่ขอโค้ดปฏิทินแล้วกัน เดี๋ยวแก้ให้ อิอิ
|
 |
 |
 |
 |
Date :
2010-03-19 21:38:02 |
By :
tungman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือใน C# visual studio 2008 แล้วจะมี TOOL ให้เลือกปฏิทินชื่อว่า month calendar แล้วสามารถดึงข้อมูลจากดาต้าเบสได้ค่ะ อยากรู้ว่าต้องใช้ event อะไร ถึงจะทำให้วันที่ปรากฏไฮไลต์ค่ะ ไม่รู้จะอธิบายยังไงค่ะ เพราะมันเป็น TOOL ไม่ใช่ปฏิทินที่เขียนด้วยโค้ดอ่ะค่ะ ช่วยด้วยนะคะ ^^
|
 |
 |
 |
 |
Date :
2010-03-19 23:05:46 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ง่าๆๆ TT^TT ช่วยด้วยนะคะ จำเป็นต้องใช้จริงๆวานผู้รู้ด้วยค่ะ ^^
|
 |
 |
 |
 |
Date :
2010-03-24 19:15:12 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
protected void Page_Load(object sender, EventArgs e)
{
Calendar1.DayRender += new DayRenderEventHandler(Calendar1_DayRender);
}
void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
//throw new Exception("The method or operation is not implemented.");
if (e.Day.Date.Day == 5)//สมมุติวันที่ 5 นัดหมาย
{
e.Cell.BackColor = System.Drawing.Color.Red;
}
}
|
 |
 |
 |
 |
Date :
2010-03-24 21:11:29 |
By :
numenoy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆค่ะ จะลองไปทำดูนะคะ เดี๋ยวจะมาบอกผล ค่าา ^^
|
 |
 |
 |
 |
Date :
2010-03-25 02:09:30 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใส่โค้ดแล้วมันขึ้นว่า Error 1 The type or namespace name 'DayRenderEventArgs' could not be found (are you missing a using directive or an assembly reference?) ค่ะ ทำไงดีคะ TT^TT
|
 |
 |
 |
 |
Date :
2010-03-25 02:28:17 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มัน winapp ครับ
ทำแบบนั้นไม่ได้หรอก แต่ทำเป็นตัวหนาได้
Code (C#)
using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MonthCalendar monthCalendar1;
private System.Windows.Forms.TextBox textBox1;
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
public Form1()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.Location = new System.Drawing.Point(48, 488);
this.textBox1.Multiline = true;
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(824, 32);
// Create the calendar.
this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
// Set the calendar location.
this.monthCalendar1.Location = new System.Drawing.Point(47, 16);
// Change the color.
this.monthCalendar1.BackColor = System.Drawing.SystemColors.Info;
this.monthCalendar1.ForeColor = System.Drawing.Color.FromArgb(
((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(192)));
this.monthCalendar1.TitleBackColor = System.Drawing.Color.Purple;
this.monthCalendar1.TitleForeColor = System.Drawing.Color.Yellow;
this.monthCalendar1.TrailingForeColor = System.Drawing.Color.FromArgb(
((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(0)));
// Add dates to the AnnuallyBoldedDates array.
this.monthCalendar1.AnnuallyBoldedDates =
new System.DateTime[] { new System.DateTime(2002, 4, 20, 0, 0, 0, 0),
new System.DateTime(2002, 4, 28, 0, 0, 0, 0),
new System.DateTime(2002, 5, 5, 0, 0, 0, 0),
new System.DateTime(2002, 7, 4, 0, 0, 0, 0),
new System.DateTime(2002, 12, 15, 0, 0, 0, 0),
new System.DateTime(2002, 12, 18, 0, 0, 0, 0)};
// Add dates to BoldedDates array.
this.monthCalendar1.BoldedDates = new System.DateTime[] {new System.DateTime(2002, 9, 26, 0, 0, 0, 0)};
// Add dates to MonthlyBoldedDates array.
this.monthCalendar1.MonthlyBoldedDates =
new System.DateTime[] {new System.DateTime(2002, 1, 15, 0, 0, 0, 0),
new System.DateTime(2002, 1, 30, 0, 0, 0, 0)};
// Configure the calendar to display 3 rows by 4 columns of months.
this.monthCalendar1.CalendarDimensions = new System.Drawing.Size(4, 3);
// Set week to begin on Monday.
this.monthCalendar1.FirstDayOfWeek = System.Windows.Forms.Day.Monday;
// Set the maximum visible date on the calendar to 12/31/2010.
this.monthCalendar1.MaxDate = new System.DateTime(2010, 12, 31, 0, 0, 0, 0);
// Set the minimum visible date on calendar to 12/31/2010.
this.monthCalendar1.MinDate = new System.DateTime(1999, 1, 1, 0, 0, 0, 0);
// Only allow 21 days to be selected at the same time.
this.monthCalendar1.MaxSelectionCount = 21;
// Set the calendar to move one month at a time when navigating using the arrows.
this.monthCalendar1.ScrollChange = 1;
// Do not show the "Today" banner.
this.monthCalendar1.ShowToday = false;
// Do not circle today's date.
this.monthCalendar1.ShowTodayCircle = false;
// Show the week numbers to the left of each week.
this.monthCalendar1.ShowWeekNumbers = true;
// Add event handlers for the DateSelected and DateChanged events
this.monthCalendar1.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateSelected);
this.monthCalendar1.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateChanged);
// Set up how the form should be displayed and add the controls to the form.
this.ClientSize = new System.Drawing.Size(920, 566);
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.textBox1, this.monthCalendar1});
this.Text = "Month Calendar Example";
}
private void monthCalendar1_DateSelected(object sender, System.Windows.Forms.DateRangeEventArgs e)
{
// Show the start and end dates in the text box.
this.textBox1.Text = "Date Selected: Start = " +
e.Start.ToShortDateString() + " : End = " + e.End.ToShortDateString();
}
private void monthCalendar1_DateChanged(object sender, System.Windows.Forms.DateRangeEventArgs e)
{
// Show the start and end dates in the text box.
this.textBox1.Text = "Date Changed: Start = " +
e.Start.ToShortDateString() + " : End = " + e.End.ToShortDateString();
}
}

|
 |
 |
 |
 |
Date :
2010-03-25 10:13:02 |
By :
tungman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนอีกนิดนะคะ ใส่โค้ด แล้วมันขึ้นว่า Error 1 The type 'WindowsFormsApplication1.Form12' already contains a definition for 'monthCalendar1' ค่ะ ลองแก้ดูแล้วก็ไม่ได้เลย TT^TT
|
 |
 |
 |
 |
Date :
2010-04-15 00:54:45 |
By :
iamkacha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอย กำลังหาโค้ทเครียดๆ ล่อซะฮาเลย
|
 |
 |
 |
 |
Date :
2010-07-31 14:42:15 |
By :
กอย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วถ้าเป็น mvc อยากทำแบบนี้บ้าง พอจะมีวิธีเขียนมั้ยคะ
|
 |
 |
 |
 |
Date :
2012-08-22 13:54:02 |
By :
giftmade303 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|