private void InitializeComponent() { this.label2 = new Atiran.UI.WindowsForms.Controls.Label(); this.txtminutestart = new Atiran.UI.WindowsForms.Controls.NumericTextBox(); this.txthourstart = new Atiran.UI.WindowsForms.Controls.NumericTextBox(); this.txtstarttime = new Atiran.UI.WindowsForms.Controls.TextBoxes.TextBox(); this.SuspendLayout(); // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.BackColor = System.Drawing.Color.White; this.label2.Font = new System.Drawing.Font("IRANSans", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(51, 5); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(22, 20); this.label2.TabIndex = 39; this.label2.Text = " : "; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // txtminutestart // this.txtminutestart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtminutestart.BackColor = System.Drawing.Color.White; this.txtminutestart.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtminutestart.Font = new System.Drawing.Font("IRANSans(FaNum)", 9.5F); this.txtminutestart.ForeColor = System.Drawing.Color.Black; this.txtminutestart.Location = new System.Drawing.Point(74, 4); this.txtminutestart.Margin = new System.Windows.Forms.Padding(10); this.txtminutestart.MaxLength = 2; this.txtminutestart.Name = "txtminutestart"; this.txtminutestart.NextControl = this.label2; this.txtminutestart.Size = new System.Drawing.Size(38, 22); this.txtminutestart.TabIndex = 37; this.txtminutestart.Text = "00"; this.txtminutestart.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtminutestart.Value = 0D; this.txtminutestart.TextChanged += new System.EventHandler(this.Txtminutestart_TextChanged); this.txtminutestart.Leave += new System.EventHandler(this.Txtminutestart_Leave); // // txthourstart // this.txthourstart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txthourstart.BackColor = System.Drawing.Color.White; this.txthourstart.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txthourstart.Font = new System.Drawing.Font("IRANSans(FaNum)", 9.5F); this.txthourstart.ForeColor = System.Drawing.Color.Black; this.txthourstart.Location = new System.Drawing.Point(8, 4); this.txthourstart.Margin = new System.Windows.Forms.Padding(10); this.txthourstart.MaxLength = 2; this.txthourstart.Name = "txthourstart"; this.txthourstart.NextControl = this.txtminutestart; this.txthourstart.Size = new System.Drawing.Size(38, 22); this.txthourstart.TabIndex = 36; this.txthourstart.Text = "00"; this.txthourstart.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txthourstart.Value = 0D; this.txthourstart.TextChanged += new System.EventHandler(this.Txthourstart_TextChanged); this.txthourstart.Leave += new System.EventHandler(this.Txthourstart_Leave); // // txtstarttime // this.txtstarttime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtstarttime.BackColor = System.Drawing.Color.White; this.txtstarttime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtstarttime.Enabled = false; this.txtstarttime.Font = new System.Drawing.Font("IRANSans(FaNum)", 9.5F); this.txtstarttime.ForeColor = System.Drawing.Color.Black; this.txtstarttime.Location = new System.Drawing.Point(3, 1); this.txtstarttime.Margin = new System.Windows.Forms.Padding(10); this.txtstarttime.Name = "txtstarttime"; this.txtstarttime.NextControl = null; this.txtstarttime.ReadOnly = true; this.txtstarttime.Size = new System.Drawing.Size(115, 29); this.txtstarttime.TabIndex = 38; this.txtstarttime.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.txtstarttime.Enter += new System.EventHandler(this.Txtstarttime_Enter); // // TimeControl // this.Controls.Add(this.label2); this.Controls.Add(this.txtminutestart); this.Controls.Add(this.txthourstart); this.Controls.Add(this.txtstarttime); this.Name = "TimeControl"; this.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.Size = new System.Drawing.Size(121, 31); this.ResumeLayout(false); this.PerformLayout(); }
public DateControl() { CanGoBackward = true; CanGoForward = false; this.ParentChanged += DateControl_ParentChanged; Wrapper = new System.Windows.Forms.FlowLayoutPanel(); Wrapper.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight; Wrapper.Margin = System.Windows.Forms.Padding.Empty; Wrapper.Dock = System.Windows.Forms.DockStyle.Fill; Year = new NumericTextBox(); YearMonth = new System.Windows.Forms.Label(); Month = new NumericTextBox(); MonthDay = new System.Windows.Forms.Label(); Day = new NumericTextBox(); this.Enter += Atiran2DateControl_Enter; this.Disposed += (sender, args) => { tt.RemoveAll(); tt.Dispose(); }; this.Leave += Atiran2DateControl_Leave; //set Today values string today = TodayFullChar(); Year.Text = today.Substring(0, 4); Month.Text = today.Substring(5, 2); Day.Text = today.Substring(8, 2); Day.TextChanged += Day_TextChanged; Month.TextChanged += Month_TextChanged; Day.Leave += Day_Leave; Month.Leave += Month_Leave; Year.Leave += Year_Leave; //Year Year.TabIndex = 2; Year.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; SetTextBoxWidthAndHeight(Year, 4); RemoveMargin(Year); RemoveBorder(Year); Wrapper.Controls.Add(Year); RemoveMargin(YearMonth); YearMonth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; YearMonth.Text = "/"; YearMonth.BackColor = Color.White; YearMonth.AutoSize = true; Wrapper.Controls.Add(YearMonth); Month.TabIndex = 1; Month.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; SetTextBoxWidthAndHeight(Month, 2); RemoveBorder(Month); RemoveMargin(Month); Wrapper.Controls.Add(Month); RemoveMargin(MonthDay); MonthDay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; MonthDay.Height = this.Height; MonthDay.Text = "/"; MonthDay.BackColor = Color.White; MonthDay.AutoSize = true; Wrapper.Controls.Add(MonthDay); Day.TabIndex = 0; Day.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; SetTextBoxWidthAndHeight(Day, 2); RemoveBorder(Day); RemoveMargin(Day); Day.Height = this.Height; Wrapper.Controls.Add(Day); this.Controls.Add(Wrapper); this.FontChanged += DateControl_FontChanged; Day.KeyDown += Day_KeyDown; Month.KeyDown += Month_KeyDown; Year.KeyDown += Year_KeyDown; YearMonth.BackColor = Year.LeaveBackColor; MonthDay.BackColor = Year.LeaveBackColor; YearMonth.ForeColor = Year.LeaveForColor; MonthDay.ForeColor = Year.LeaveForColor; }