コード例 #1
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.mainMenu1  = new System.Windows.Forms.MainMenu();
     this.OurDateBox = new YaoDurant.Gui.DateBox();
     //
     // OurDateBox
     //
     this.OurDateBox.BackColor = System.Drawing.Color.White;
     this.OurDateBox.Date      = new System.DateTime(2003, 8, 5, 19, 10, 30, 796);
     this.OurDateBox.Location  = new System.Drawing.Point(48, 72);
     this.OurDateBox.MaxValue  = new System.DateTime(9999, 12, 31, 23, 59, 59, 999);
     this.OurDateBox.MinValue  = new System.DateTime(((long)(0)));
     this.OurDateBox.Size      = new System.Drawing.Size(88, 20);
     this.OurDateBox.Text      = "8/5/2003";
     //
     // FormMain
     //
     this.Controls.Add(this.OurDateBox);
     this.Menu  = this.mainMenu1;
     this.Text  = "Test Date Control";
     this.Load += new System.EventHandler(this.FormMain_Load);
 }
コード例 #2
0
        public TaskStatus()
        {
            // Set background color to light gray.
            this.BackColor = Color.LightSlateGray;

            // Create two DateBoxes and two TextBoxes
            tskdtBegin             = new DateBox();
            tskdtBegin.Parent      = this;
            tskdtBegin.Validating +=
                new CancelEventHandler(this.Dates_Validating);
            tskdtEnd             = new DateBox();
            tskdtEnd.Parent      = this;
            tskdtEnd.Validating +=
                new CancelEventHandler(this.Dates_Validating);
            txtEstimated        = new TextBox();
            txtEstimated.Parent = this;
            txtEstimated.Width  = tskdtBegin.Width / 2;
            txtActual           = new TextBox();
            txtActual.Parent    = this;
            txtActual.Width     = tskdtBegin.Width / 2;

            // Position them from left to right to fill this.
            int PrevRight = 0;

            foreach (Control cntlX in this.Controls)
            {
                cntlX.Left    = PrevRight;
                PrevRight    += cntlX.Width;
                cntlX.Visible = true;
            }
            this.Height = tskdtEnd.Height;
            this.Width  = PrevRight + (this.Height / 3);

            // Set the Mode.
            this.m_Mode = Modes.modeText;
        }