⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgdatareportmodelname.cs

📁 报刊广告管理系统。CSharp编写
💻 CS
字号:
using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Windows.Forms;namespace WWAM.Forms.Dlg{	public class DlgDataReportModelName : WWAM.Forms.Dlg.DlgBase	{
		#region DlgDataReportModelName		private DevExpress.XtraEditors.TextEdit txtReportModelName;		private System.ComponentModel.IContainer components = null;		public DlgDataReportModelName()		{			// 该调用是 Windows 窗体设计器所必需的。			InitializeComponent();			// TODO: 在 InitializeComponent 调用后添加任何初始化		}		public DlgDataReportModelName(Form form):base(form)		{			// 该调用是 Windows 窗体设计器所必需的。			InitializeComponent();			// TODO: 在 InitializeComponent 调用后添加任何初始化		}		/// <summary>		/// 清理所有正在使用的资源。		/// </summary>		protected override void Dispose( bool disposing )		{			if( disposing )			{				if (components != null) 				{					components.Dispose();				}			}			base.Dispose( disposing );		}		#region 设计器生成的代码		/// <summary>		/// 设计器支持所需的方法 - 不要使用代码编辑器修改		/// 此方法的内容。		/// </summary>		private void InitializeComponent()		{			this.txtReportModelName = new DevExpress.XtraEditors.TextEdit();
			((System.ComponentModel.ISupportInitialize)(this.txtReportModelName.Properties)).BeginInit();
			this.SuspendLayout();
			// 
			// btnAccept
			// 
			this.btnAccept.Location = new System.Drawing.Point(136, 48);
			this.btnAccept.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnAccept.LookAndFeel.UseWindowsXPTheme = false;
			this.btnAccept.Name = "btnAccept";
			this.btnAccept.TabIndex = 1;
			this.btnAccept.Text = "保 存";
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(224, 48);
			this.btnCancel.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnCancel.LookAndFeel.UseWindowsXPTheme = false;
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 2;
			// 
			// txtReportModelName
			// 
			this.txtReportModelName.EditValue = "";
			this.txtReportModelName.Location = new System.Drawing.Point(16, 16);
			this.txtReportModelName.Name = "txtReportModelName";
			// 
			// txtReportModelName.Properties
			// 
			this.txtReportModelName.Properties.AppearanceFocused.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(224)), ((System.Byte)(192)));
			this.txtReportModelName.Properties.AppearanceFocused.Options.UseBackColor = true;
			this.txtReportModelName.Properties.MaxLength = 20;
			this.txtReportModelName.Size = new System.Drawing.Size(288, 21);
			this.txtReportModelName.TabIndex = 0;
			this.txtReportModelName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtReportModelName_KeyPress);
			// 
			// DlgDataReportModelName
			// 
			this.AcceptButton = this.btnAccept;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(314, 80);
			this.Controls.Add(this.txtReportModelName);
			this.Name = "DlgDataReportModelName";
			this.Text = "报表模版名称";
			this.Controls.SetChildIndex(this.txtReportModelName, 0);
			this.Controls.SetChildIndex(this.btnCancel, 0);
			this.Controls.SetChildIndex(this.btnAccept, 0);
			((System.ComponentModel.ISupportInitialize)(this.txtReportModelName.Properties)).EndInit();
			this.ResumeLayout(false);

		}		#endregion		#endregion		#region Property		public string GetReportModelName		{			get			{				return this.txtReportModelName.Text.Trim();			}		}		#endregion		#region CanClose		protected override bool CanClose()
		{
			if(ControlEmpty(this.txtReportModelName,"请输入报表模版名称"))return false;
			return base.CanClose ();
		}		#endregion		#region OnFormShow		protected override void OnFormShow()
		{
			base.OnFormShow ();
			this.txtReportModelName.Focus();
		}		#endregion		#region ShowDialog		public new DialogResult ShowDialog()		{			this.txtReportModelName.Text = "";			return base.ShowDialog();		}		#endregion

		#region 控制名称中不出现非法字符
		private void txtReportModelName_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(WWAM.Cast.FileNameUnusedChar(e.KeyChar))
			{
				SetToolTip((Control)sender,"名称中不能出现下列字符之一\r\n\\ / : * ? \" < > |");
				//baseToolTip.Active = true;
				e.Handled = true;
			}
			else
			{
				HideToolTip();
			}
		}
		#endregion	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -