📄 ucdate.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Tracker7UI.common
{
/// <summary>
/// Summary description for UCDate.
/// </summary>
public class UCDate : System.Windows.Forms.UserControl
{
private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor ultraDateTimeEditor1;
private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor1;
private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public UCDate()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitializeComponent call
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ultraDateTimeEditor1 = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
this.ultraCheckEditor1 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
this.ultraCheckEditor2 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
((System.ComponentModel.ISupportInitialize)(this.ultraDateTimeEditor1)).BeginInit();
this.SuspendLayout();
//
// ultraDateTimeEditor1
//
this.ultraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2003;
this.ultraDateTimeEditor1.Dock = System.Windows.Forms.DockStyle.Left;
this.ultraDateTimeEditor1.Location = new System.Drawing.Point(16, 0);
this.ultraDateTimeEditor1.Name = "ultraDateTimeEditor1";
this.ultraDateTimeEditor1.Size = new System.Drawing.Size(88, 21);
this.ultraDateTimeEditor1.TabIndex = 15;
this.ultraDateTimeEditor1.Value = null;
//
// ultraCheckEditor1
//
this.ultraCheckEditor1.Dock = System.Windows.Forms.DockStyle.Left;
this.ultraCheckEditor1.FlatMode = true;
this.ultraCheckEditor1.Location = new System.Drawing.Point(0, 0);
this.ultraCheckEditor1.Name = "ultraCheckEditor1";
this.ultraCheckEditor1.Size = new System.Drawing.Size(16, 22);
this.ultraCheckEditor1.TabIndex = 16;
this.ultraCheckEditor1.CheckedChanged += new System.EventHandler(this.ultraCheckEditor1_CheckedChanged);
//
// ultraCheckEditor2
//
this.ultraCheckEditor2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraCheckEditor2.FlatMode = true;
this.ultraCheckEditor2.Location = new System.Drawing.Point(104, 0);
this.ultraCheckEditor2.Name = "ultraCheckEditor2";
this.ultraCheckEditor2.Size = new System.Drawing.Size(120, 22);
this.ultraCheckEditor2.TabIndex = 17;
this.ultraCheckEditor2.Text = "N/A";
this.ultraCheckEditor2.CheckedChanged += new System.EventHandler(this.ultraCheckEditor2_CheckedChanged);
//
// UCDate
//
this.Controls.Add(this.ultraCheckEditor2);
this.Controls.Add(this.ultraDateTimeEditor1);
this.Controls.Add(this.ultraCheckEditor1);
this.Name = "UCDate";
this.Size = new System.Drawing.Size(224, 22);
((System.ComponentModel.ISupportInitialize)(this.ultraDateTimeEditor1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void ultraCheckEditor1_CheckedChanged(object sender, System.EventArgs e)
{
ultraCheckEditor1.Checked = false;
ultraDateTimeEditor1.DateTime = DateTime.Now;
}
private void ultraCheckEditor2_CheckedChanged(object sender, System.EventArgs e)
{
if (ultraCheckEditor2.Checked == true)
{
ultraDateTimeEditor1.Enabled = false;
}
else
{
ultraDateTimeEditor1.Enabled = true;
ultraDateTimeEditor1.DateTime = DateTime.Now;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -