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

📄 mapallscreendisplay.cs

📁 c#编写的汽车销售公司erp进销存系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CallCenter.Modules;

namespace CallCenter.BusinessInterfaces.MainForms
{
	/// <summary>
	/// MapAllScreenDisplay 的摘要说明。
	/// </summary>
	public class MapAllScreenDisplay : System.Windows.Forms.Form
	{

		private System.Windows.Forms.Timer timer1;
		private DevExpress.XtraEditors.PanelControl panel1;
		private System.Windows.Forms.Label label1;
		private AxMapXLib.AxMap axMap1;
		private System.ComponentModel.IContainer components;
	
		public MapAllScreenDisplay()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		public static void Main()
		{
			Application.Run(new MapAllScreenDisplay());
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MapAllScreenDisplay));
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.panel1 = new DevExpress.XtraEditors.PanelControl();
			this.label1 = new System.Windows.Forms.Label();
			this.axMap1 = new AxMapXLib.AxMap();
			((System.ComponentModel.ISupportInitialize)(this.panel1)).BeginInit();
			this.panel1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.axMap1)).BeginInit();
			this.SuspendLayout();
			// 
			// timer1
			// 
			this.timer1.Enabled = true;
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			// 
			// panel1
			// 
			this.panel1.Appearance.BackColor = System.Drawing.Color.Transparent;
			this.panel1.Appearance.Options.UseBackColor = true;
			this.panel1.Controls.Add(this.label1);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
			this.panel1.Location = new System.Drawing.Point(0, 384);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(568, 40);
			this.panel1.TabIndex = 5;
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.Location = new System.Drawing.Point(8, 9);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(280, 23);
			this.label1.TabIndex = 0;
			this.label1.Text = "社区服务呼叫中心系统";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// axMap1
			// 
			this.axMap1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.axMap1.Enabled = true;
			this.axMap1.Location = new System.Drawing.Point(0, 0);
			this.axMap1.Name = "axMap1";
			this.axMap1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMap1.OcxState")));
			this.axMap1.Size = new System.Drawing.Size(568, 384);
			this.axMap1.TabIndex = 6;
			// 
			// MapAllScreenDisplay
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.White;
			this.ClientSize = new System.Drawing.Size(568, 424);
			this.Controls.Add(this.axMap1);
			this.Controls.Add(this.panel1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "MapAllScreenDisplay";
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "分屏显示";
			this.TopMost = true;
			this.Load += new System.EventHandler(this.MapAllScreenDisplay_Load);
			((System.ComponentModel.ISupportInitialize)(this.panel1)).EndInit();
			this.panel1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.axMap1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void timer1_Tick(object sender, System.EventArgs e)
		{
			this.label1.Left=this.label1.Left -10;
			if(this.label1.Left+this.label1.Width<=0)
			{
				this.label1.Left=this.panel1.Left+this.panel1.Width;
			}
		}

		private void MapAllScreenDisplay_Load(object sender, System.EventArgs e)
		{
			try
			{
				Rectangle rect=new Rectangle();
				rect=Screen.GetWorkingArea(this);
				this.Left=rect.Width;
				this.Top=rect.Y;
				Rectangle rect1=new Rectangle();
				rect1=Screen.GetWorkingArea(this);
				this.Width=rect.Width;
				this.Height=rect.Height;
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			try
			{
				Rectangle rect=new Rectangle();
				rect=Screen.GetWorkingArea(this);
				this.Left=rect.Width;
				this.Top=rect.Y;
				Rectangle rect1=new Rectangle();
				rect1=Screen.GetWorkingArea(this);
				this.Width=rect.Width;
				this.Height=rect.Height;
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}

		private void axMap1_SelectionChanged(object sender, System.EventArgs e)
		{
		
		}

		public void selectMap(string displayArea,CustomerInfo info)
		{
		    this.axMap1.Layers[displayArea].Selection.ClearSelection();
			MapXLib.Feature fea = this.axMap1.Layers[displayArea].GetFeatureByKey(info.position.ToString());
			if(fea!=null)
			{
				this.axMap1.Layers[displayArea].Selection.Add(fea);
			}
			this.label1.Text="用户名称:"+info.cname+",电话:"+info.ctelnumber+",地址:"+info.caddress;
			int lenghth=this.label1.Text.Length;
			this.label1.Width=lenghth*20;
		}
		//
		public event AlertingMapHandler AlertingMap = null;
		private void onAlertingMap(object o)
		{
			if(AlertingMap!=null && o is CustomerInfo)
			{
				AlertingMapEventArgs ev = new AlertingMapEventArgs();
				ev.customerInfo = (CustomerInfo)o;
				AlertingMap(this,ev);
			}
		}
	}
		/// <summary>
		/// 自定义事件,当有来电时或查询时启动该事件
		/// author:yanqingxi
		/// </summary>
		public class AlertingMapEventArgs : EventArgs
		{
			public CustomerInfo customerInfo=null;
		}
		public delegate void AlertingMapHandler(object sender,AlertingMapEventArgs ev);
	
}

⌨️ 快捷键说明

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