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

📄 viewdata.cs

📁 Symbol MC3000 Visual C 条码扫码范例程序之1
💻 CS
字号:
//--------------------------------------------------------------------
// FILENAME: ViewData.cs
//
// Copyright(c) 2005 Symbol Technologies Inc. All rights reserved.
//
// DESCRIPTION:
//
// NOTES:
//
// 
//--------------------------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using System.Reflection;

namespace CS_ScanSample2
{
	/// <summary>
	/// Summary description for ViewData.
	/// </summary>
	public class ViewData : System.Windows.Forms.Form
	{
		public ViewData()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

            this.OKButton.Focus();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
#if COMPLETE_FRAMEWORK
		protected override void Dispose( bool disposing )
		{
			base.Dispose( disposing );
		}
#endif

		#region Windows Form 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.CancelButton = new System.Windows.Forms.Button();
			this.OKButton = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.ViewDataListBox = new System.Windows.Forms.ListBox();
            this.SuspendLayout();
			// 
			// CancelButton
			// 
			this.CancelButton.Location = new System.Drawing.Point(168, 240);
            this.CancelButton.Name = "CancelButton";
			this.CancelButton.Size = new System.Drawing.Size(64, 25);
            this.CancelButton.TabIndex = 1;
			this.CancelButton.Text = "Cancel";
			this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click);
            this.CancelButton.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CancelButton_KeyDown);
			// 
			// OKButton
			// 
			this.OKButton.Location = new System.Drawing.Point(8, 240);
            this.OKButton.Name = "OKButton";
			this.OKButton.Size = new System.Drawing.Size(64, 25);
            this.OKButton.TabIndex = 0;
			this.OKButton.Text = "OK";
			this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
            this.OKButton.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OKButton_KeyDown);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(224, 24);
			this.label1.Text = "Data Scanned:";
			// 
			// ViewDataListBox
			// 
			this.ViewDataListBox.Location = new System.Drawing.Point(8, 32);
            this.ViewDataListBox.Name = "ViewDataListBox";
            this.ViewDataListBox.Size = new System.Drawing.Size(224, 178);
            this.ViewDataListBox.TabIndex = 2;
			// 
			// ViewData
			// 
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
			this.BackColor = System.Drawing.Color.White;
			this.ClientSize = new System.Drawing.Size(240, 270);
			this.Controls.Add(this.ViewDataListBox);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.CancelButton);
			this.Controls.Add(this.OKButton);
            this.Name = "ViewData";
			this.Text = "ViewData";
            this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ViewData_KeyUp);
			this.Load += new System.EventHandler(this.ViewData_Load);
            this.ResumeLayout(false);

		}
		#endregion

		private System.Windows.Forms.Label label1;

		private string m_sData;
		private System.Windows.Forms.ListBox ViewDataListBox;

		private Symbol.Barcode.Reader m_clsReader;
		
		public static void Run(string sData,Symbol.Barcode.Reader clsReader)
		{
			ViewData v = new ViewData();

			v.m_clsReader = clsReader;

			v.m_sData = sData;
			
            ReaderForm.ScaleDown(v);
			
			v.ShowDialog();
		}

		private System.Windows.Forms.Button CancelButton;
		private System.Windows.Forms.Button OKButton;

		private void ViewData_Load(object sender, System.EventArgs e)
		{
			ViewDataListBox.Items.Add(m_sData);

			// Add MainMenu if Pocket PC
			if(Symbol.Win32.PlatformType == "PocketPC")
			{
				this.Menu = new MainMenu();
			}

		}

		private void OKButton_Click(object sender, System.EventArgs e)
		{
			Close();
		}

		private void CancelButton_Click(object sender, System.EventArgs e)
		{
			Close();
		}
        private void OKButton_KeyDown(object sender, KeyEventArgs e)
        {
            // Checks if the key pressed was an enter button (character code 13)
            if (e.KeyValue == (char)13)
                OKButton_Click(this, e);
        }

        private void CancelButton_KeyDown(object sender, KeyEventArgs e)
        {
            // Checks if the key pressed was an enter button (character code 13)
            if (e.KeyValue == (char)13)
                CancelButton_Click(this, e);
        }
        private void ViewData_KeyUp(object sender, KeyEventArgs e)
        {
            this.OKButton.Focus();
        }
	}
}

⌨️ 快捷键说明

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