I have this code, it shows only the month button, please show me the error I did
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
namespace Uis.Calendar
{
public partial class ucCalander : UserControl
{
string[] weekDays = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
string[] MonthArray = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
string[] DayArray = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "..." };
public ucCalander()
{
InitializeComponent();
}
private void ucCalander_Load(object sender, EventArgs e)
{
CreateMonthButtons();
CreateDayButtons();
DisplayWeekDays();
}
# region Button Create
private void CreateMonthButtons()
{
int lnRowMonth = 10;
int lnColMonth = 10;
for (int i = 0; i < 13; i++)
{
MonthButton btnMonth = new MonthButton();
btnMonth.Location = new Point(lnRowMonth, lnColMonth);
btnMonth.Size = new Size(80, 40);
btnMonth.Name = "btnMonth" + i;
btnMonth.Text = MonthArray[i];
btnMonth.BackColor = Color.Yellow;
btnMonth.Click += new EventHandler(btnMonth_Click);
lnColMonth = lnColMonth + 40;
btnMonth.Tag = i.ToString();
this.Controls.Add(btnMonth);
}
}
private void CreateDayButtons()
{
int lnRowDay = 10;
int lnColDay = 10;
for (int i = 0; i < 13; i++)
{
DayButton btnDay = new DayButton();
btnDay.Location = new Point(lnRowDay, lnColDay);
btnDay.Size = new Size(80, 40);
btnDay.Name = "btnDay" + i;
btnDay.Text = DayArray[i];
btnDay.BackColor = Color.Yellow;
btnDay.Click += new EventHandler(btnDay_Click);
lnRowDay = lnRowDay + 70;
btnDay.Tag = i.ToString();
this.Controls.Add(btnDay);
}
}
private void DisplayWeekDays()
{
int lnRowLabel = 150;
int lnColLabel = 10;
for (int i = 0; i < 8; i++)
{
Label lblWeekDays = new Label();
lblWeekDays.Location = new Point(lnRowLabel, lnColLabel);
lblWeekDays.Text = weekDays[i];
lblWeekDays.ForeColor = Color.Red;
lblWeekDays.Font = new Font("Arial", 12, FontStyle.Bold);
lnRowLabel = lnRowLabel + 100;
lblWeekDays.Tag = (i + 12).ToString();
this.Controls.Add(lblWeekDays);
}
}
# endregion Button Create
# region Click
private void btnMonth_Click(object sender, EventArgs e)
{
}
private void btnDay_Click(object sender, EventArgs e)
{
}
# endregion Click
}
}
thanks in advance