using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using iTripLog.Date;

namespace iTripLog.Map
{
    class CalendarPanel:Panel
    { 
        public CalendarPanel()
        {
            InitializeComponent();
        }

        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            this.button1.Visible = true;
            this.textBox1.Visible = true;
            this.textBox2.Visible = true;
            this.label1.Visible = true;
            this.textBox2.Text = this.monthCalendar1.SelectionStart.ToString(); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            this.textBox1.Visible = false;
            this.textBox2.Visible = false;
            this.label1.Visible = false;
            this.button1.Visible = false;
            TextBox T=new TextBox();
            T.Text=this.textBox2.Text+":"+this.textBox1.Text;
            this.listBox1.Items.Add(this.textBox2.Text + ":" + this.textBox1.Text);
            this.listBox1.Visible = true;

        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            //this.Close();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.listBox1.Visible = false;
            this.listBox1.SelectedItem.ToString();
            this.textBox2.Text = listBox1.SelectedItem.ToString();
            this.textBox1.Text = "";
            this.textBox1.Visible = true;
            this.textBox2.Visible = true;
            this.label1.Visible = true;
            this.button1.Visible = true;
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.listBox1.Visible = false;
            this.listBox1.SelectedItem.ToString();
            this.textBox2.Text = listBox1.SelectedItem.ToString();
            this.textBox1.Text = "";
            this.textBox1.Visible = true;
            this.textBox2.Visible = true;
            this.label1.Visible = true;
            this.button1.Visible = true;
        }

        private void DateForm_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private System.Windows.Forms.MainMenu mainMenu1;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源，为 true；否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        /// 
        private PictureBox pictureBox1 = new PictureBox();
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DateForm));
            this.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.menuItem1 = new System.Windows.Forms.MenuItem();
            this.menuItem2 = new System.Windows.Forms.MenuItem();
            this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.listBox1 = new System.Windows.Forms.ListBox();
            this.SuspendLayout();
            // 
            // mainMenu1
            // 
            this.mainMenu1.MenuItems.Add(this.menuItem1);
            this.mainMenu1.MenuItems.Add(this.menuItem2);
            this.pictureBox1.Image = new System.Drawing.Bitmap("Storage Card\\Images\\image\\background.jpg");
            this.Controls.Add(pictureBox1);
            // 
            // menuItem1
            // 
            resources.ApplyResources(this.menuItem1, "menuItem1");
            this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
            // 
            // menuItem2
            // 
            resources.ApplyResources(this.menuItem2, "menuItem2");
            this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
            // 
            // monthCalendar1
            // 
            resources.ApplyResources(this.monthCalendar1, "monthCalendar1");
            this.monthCalendar1.Name = "monthCalendar1";
            this.monthCalendar1.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateChanged);
            this.monthCalendar1.Size = new System.Drawing.Size(40, 40);
            this.monthCalendar1.Location = new System.Drawing.Point(2, 5);
            // 
            // textBox1
            // 
            this.textBox1.AcceptsReturn = true;
            this.textBox1.AcceptsTab = true;
            resources.ApplyResources(this.textBox1, "textBox1");
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(40, 10);
            this.textBox1.Location = new System.Drawing.Point(50, 5);
            // 
            // label1
            // 
            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.label1.ForeColor = System.Drawing.Color.White;
            resources.ApplyResources(this.label1, "label1");
            this.label1.Name = "label1";
            this.textBox1.Size = new System.Drawing.Size(40,10);
            this.textBox1.Location = new System.Drawing.Point(50, 20);
            // 
            // button1
            // 
            resources.ApplyResources(this.button1, "button1");
            this.button1.Name = "button1";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            this.textBox1.Size = new System.Drawing.Size(40,10);
            this.textBox1.Location = new System.Drawing.Point(50, 40);
            // 
            // textBox2
            // 
            this.textBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.textBox2.ForeColor = System.Drawing.SystemColors.InactiveCaptionText;
            resources.ApplyResources(this.textBox2, "textBox2");
            this.textBox2.Name = "textBox2";
            this.textBox1.Size = new System.Drawing.Size(60, 20);
            this.textBox1.Location = new System.Drawing.Point(70, 55);
            // 
            // listBox1
            // 
            this.listBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.listBox1.ForeColor = System.Drawing.Color.White;
            resources.ApplyResources(this.listBox1, "listBox1");
            this.listBox1.Name = "listBox1";
            this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
            this.listBox1.Size = new System.Drawing.Size(65, 120);
            this.listBox1.Location = new System.Drawing.Point(70, 5);
            // 
            // DateForm
            // 
            //this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            resources.ApplyResources(this, "$this");
            //this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.BackColor = System.Drawing.Color.Gray;
            this.Controls.Add(this.textBox2); textBox2.BringToFront();
            this.Controls.Add(this.button1); button1.BringToFront();
            this.Controls.Add(this.textBox1); textBox1.BringToFront();
            this.Controls.Add(this.label1); label1.BringToFront();
            this.Controls.Add(this.monthCalendar1); monthCalendar1.BringToFront();
            this.Controls.Add(this.listBox1); listBox1.BringToFront();
            //this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            //this.Menu = this.mainMenu1;
            this.Name = "DateForm";
            //this.StretchImage = true;
           // this.Load += new System.EventHandler(this.DateForm_Load);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.MonthCalendar monthCalendar1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.ListBox listBox1;
        private System.Windows.Forms.MenuItem menuItem1;
        private System.Windows.Forms.MenuItem menuItem2;

    }
}
