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

📄 navbarbtns.cs

📁 报刊广告管理系统。CSharp编写
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

using System.Threading;

namespace WWAM.BLL
{
	/// <summary>
	/// NavBarBtns 的摘要说明。
	/// </summary>
	public class NavBarBtns : System.Windows.Forms.UserControl
	{
		#region NavBarBtns

		private DevExpress.XtraEditors.SimpleButton btnExcel;
		private DevExpress.XtraEditors.SimpleButton btnEdit;
		private DevExpress.XtraEditors.SimpleButton btnFind;
		private DevExpress.XtraEditors.SimpleButton btnPrint;
		private DevExpress.XtraEditors.SimpleButton btnRefresh;
		private DevExpress.XtraEditors.SimpleButton btnDelete;
		private DevExpress.XtraEditors.SimpleButton btnAppend;
		private DevExpress.XtraEditors.PanelControl panelButtons;
		private System.ComponentModel.IContainer components = null;

		public NavBarBtns()
		{
			// 该调用是 Windows.Forms 窗体设计器所必需的。
			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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(NavBarBtns));
			this.panelButtons = new DevExpress.XtraEditors.PanelControl();
			this.btnExcel = new DevExpress.XtraEditors.SimpleButton();
			this.btnEdit = new DevExpress.XtraEditors.SimpleButton();
			this.btnFind = new DevExpress.XtraEditors.SimpleButton();
			this.btnPrint = new DevExpress.XtraEditors.SimpleButton();
			this.btnRefresh = new DevExpress.XtraEditors.SimpleButton();
			this.btnDelete = new DevExpress.XtraEditors.SimpleButton();
			this.btnAppend = new DevExpress.XtraEditors.SimpleButton();
			((System.ComponentModel.ISupportInitialize)(this.panelButtons)).BeginInit();
			this.panelButtons.SuspendLayout();
			this.SuspendLayout();
			// 
			// panelButtons
			// 
			this.panelButtons.Controls.Add(this.btnExcel);
			this.panelButtons.Controls.Add(this.btnEdit);
			this.panelButtons.Controls.Add(this.btnFind);
			this.panelButtons.Controls.Add(this.btnRefresh);
			this.panelButtons.Controls.Add(this.btnDelete);
			this.panelButtons.Controls.Add(this.btnAppend);
			this.panelButtons.Controls.Add(this.btnPrint);
			this.panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panelButtons.Location = new System.Drawing.Point(0, 0);
			this.panelButtons.Name = "panelButtons";
			this.panelButtons.Size = new System.Drawing.Size(138, 28);
			this.panelButtons.TabIndex = 0;
			this.panelButtons.Text = "panelControl1";
			// 
			// btnExcel
			// 
			this.btnExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnExcel.Image")));
			this.btnExcel.Location = new System.Drawing.Point(90, 2);
			this.btnExcel.LookAndFeel.SkinName = "The Asphalt World";
			this.btnExcel.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnExcel.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnExcel.LookAndFeel.UseWindowsXPTheme = false;
			this.btnExcel.Name = "btnExcel";
			this.btnExcel.Size = new System.Drawing.Size(24, 24);
			this.btnExcel.TabIndex = 0;
			this.btnExcel.Tag = "Excel";
			this.btnExcel.ToolTip = "导出";
			this.btnExcel.Click += new System.EventHandler(this.btnExcel_Click);
			// 
			// btnEdit
			// 
			this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image")));
			this.btnEdit.Location = new System.Drawing.Point(46, 2);
			this.btnEdit.LookAndFeel.SkinName = "The Asphalt World";
			this.btnEdit.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnEdit.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnEdit.LookAndFeel.UseWindowsXPTheme = false;
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.Size = new System.Drawing.Size(24, 24);
			this.btnEdit.TabIndex = 16;
			this.btnEdit.Tag = "Edit";
			this.btnEdit.ToolTip = "修改";
			this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
			// 
			// btnFind
			// 
			this.btnFind.Image = ((System.Drawing.Image)(resources.GetObject("btnFind.Image")));
			this.btnFind.Location = new System.Drawing.Point(68, 2);
			this.btnFind.LookAndFeel.SkinName = "The Asphalt World";
			this.btnFind.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnFind.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnFind.LookAndFeel.UseWindowsXPTheme = false;
			this.btnFind.Name = "btnFind";
			this.btnFind.Size = new System.Drawing.Size(24, 24);
			this.btnFind.TabIndex = 17;
			this.btnFind.Tag = "Find";
			this.btnFind.ToolTip = "查询";
			this.btnFind.Click += new System.EventHandler(this.btnFind_Click);
			// 
			// btnPrint
			// 
			this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
			this.btnPrint.Location = new System.Drawing.Point(112, 2);
			this.btnPrint.LookAndFeel.SkinName = "The Asphalt World";
			this.btnPrint.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnPrint.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnPrint.LookAndFeel.UseWindowsXPTheme = false;
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new System.Drawing.Size(24, 24);
			this.btnPrint.TabIndex = 19;
			this.btnPrint.Tag = "Print";
			this.btnPrint.ToolTip = "打印";
			this.btnPrint.Visible = false;
			this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
			// 
			// btnRefresh
			// 
			this.btnRefresh.Image = ((System.Drawing.Image)(resources.GetObject("btnRefresh.Image")));
			this.btnRefresh.Location = new System.Drawing.Point(112, 2);
			this.btnRefresh.LookAndFeel.SkinName = "The Asphalt World";
			this.btnRefresh.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnRefresh.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnRefresh.LookAndFeel.UseWindowsXPTheme = false;
			this.btnRefresh.Name = "btnRefresh";
			this.btnRefresh.Size = new System.Drawing.Size(24, 24);
			this.btnRefresh.TabIndex = 20;
			this.btnRefresh.Tag = "Refresh";
			this.btnRefresh.ToolTip = "刷新";
			this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
			// 
			// btnDelete
			// 
			this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
			this.btnDelete.Location = new System.Drawing.Point(24, 2);
			this.btnDelete.LookAndFeel.SkinName = "The Asphalt World";
			this.btnDelete.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnDelete.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnDelete.LookAndFeel.UseWindowsXPTheme = false;
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.Size = new System.Drawing.Size(24, 24);
			this.btnDelete.TabIndex = 15;
			this.btnDelete.Tag = "Delete";
			this.btnDelete.ToolTip = "删除";
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// btnAppend
			// 
			this.btnAppend.Image = ((System.Drawing.Image)(resources.GetObject("btnAppend.Image")));
			this.btnAppend.Location = new System.Drawing.Point(2, 2);
			this.btnAppend.LookAndFeel.SkinName = "The Asphalt World";
			this.btnAppend.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
			this.btnAppend.LookAndFeel.UseDefaultLookAndFeel = false;
			this.btnAppend.LookAndFeel.UseWindowsXPTheme = false;
			this.btnAppend.Name = "btnAppend";
			this.btnAppend.Size = new System.Drawing.Size(24, 24);
			this.btnAppend.TabIndex = 14;
			this.btnAppend.Tag = "Append";
			this.btnAppend.ToolTip = "添加";
			this.btnAppend.Click += new System.EventHandler(this.btnAppend_Click);
			// 
			// NavBarBtns
			// 
			this.Controls.Add(this.panelButtons);
			this.Name = "NavBarBtns";
			this.Size = new System.Drawing.Size(138, 28);
			((System.ComponentModel.ISupportInitialize)(this.panelButtons)).EndInit();
			this.panelButtons.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion
		
		#endregion

		#region Variable
		int refreshDelay = 5;
		bool VisibleAppend = true;
		bool VisibleDelete = true;
		bool VisibleEdit = true;
		bool VisibleFind = true;
		bool VisibleExcel = true;
		bool VisiblePrint = false;
		bool VisibleRefresh = true;
		DevExpress.XtraGrid.GridControl gridCtrl = null;
		#endregion

		#region Property
		#region GridControl
		[DefaultValue(null)]
		public DevExpress.XtraGrid.GridControl GridCtrl
		{
			get
			{
				return gridCtrl;
			}
			set
			{
				gridCtrl = value;
			}
		}
		#endregion
		#region ButtonVisible
		[DefaultValue(true)]
		public bool ButtonAppend
		{
			get
			{
				return VisibleAppend;
			}
			set
			{
				VisibleAppend = value;
				this.Invalidate();
			}
		}
		[DefaultValue(true)]
		public bool ButtonDelete
		{
			get
			{
				return VisibleDelete;
			}
			set
			{
				VisibleDelete = value;
				this.Invalidate();
			}
		}
		[DefaultValue(true)]
		public bool ButtonEdit
		{
			get
			{
				return VisibleEdit;
			}
			set
			{
				VisibleEdit = value;
				this.Invalidate();
			}
		}
		[DefaultValue(true)]
		public bool ButtonFind
		{
			get
			{
				return VisibleFind;
			}
			set
			{
				VisibleFind = value;
				this.Invalidate();
			}
		}
		[DefaultValue(true)]
		public bool ButtonExcel
		{
			get
			{
				return VisibleExcel;
			}
			set
			{
				VisibleExcel = value;
				this.Invalidate();
			}
		}
		[DefaultValue(false)]
		public bool ButtonPrint
		{
			get
			{
				return VisiblePrint;
			}
			set
			{
				VisiblePrint = value;
				this.Invalidate();
			}
		}
		[DefaultValue(true)]
		public bool ButtonRefresh
		{
			get
			{
				return VisibleRefresh;
			}
			set
			{
				VisibleRefresh = value;
				this.Invalidate();
			}
		}
		#endregion

⌨️ 快捷键说明

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