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

📄 frmsendtext.cs

📁 通过手机蓝牙控制个人电脑上的幻灯片的播放
💻 CS
字号:
#region Using directives

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;

#endregion

namespace UI
{
    /// <summary>
    /// Summary description for frmSendText.
    /// </summary>
    public class frmSendText : System.Windows.Forms.Form
    {
        private MenuItem menuItemSend;
        private MenuItem menuItem2;
        private TextBox txtBoxSent;
        private Label label1;
        private BTHWrapper.BTHConnector _connector;
        private Status _Status;
        /// <summary>
        /// Main menu for the form.
        /// </summary>
        private System.Windows.Forms.MainMenu mainMenu1;

        public frmSendText(Form parentForm, BTHWrapper.BTHConnector inConn)
        {
            _connector = inConn;
            InitializeComponent();
        }

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

        #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.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.menuItemSend = new System.Windows.Forms.MenuItem();
            this.txtBoxSent = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.menuItem2 = new System.Windows.Forms.MenuItem();
            // 
            // mainMenu1
            // 
            this.mainMenu1.MenuItems.Add(this.menuItemSend);
            this.mainMenu1.MenuItems.Add(this.menuItem2);
            // 
            // menuItemSend
            // 
            this.menuItemSend.Text = "Send";
            this.menuItemSend.Click += new System.EventHandler(this.menuItem1_Click);
            // 
            // txtBoxSent
            // 
            this.txtBoxSent.Location = new System.Drawing.Point(14, 53);
            this.txtBoxSent.Size = new System.Drawing.Size(207, 33);
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(14, 20);
            this.label1.Size = new System.Drawing.Size(207, 30);
            this.label1.Text = "Text to be Sent:";
            // 
            // menuItem2
            // 
            this.menuItem2.Text = "Back";
            this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
            // 
            // frmSendText
            // 
            this.ClientSize = new System.Drawing.Size(240, 266);
            this.Controls.Add(this.txtBoxSent);
            this.Controls.Add(this.label1);
            this.Menu = this.mainMenu1;
            this.Text = "Input Text";

        }

        #endregion

        private void menuItem1_Click(object sender, EventArgs e)
        {
            string strSendText= "MCE:TXT|";
            strSendText += this.txtBoxSent.Text;
            if (strSendText.Length > 0)
            {
                _connector.SendMessage(strSendText);
            }
            this.txtBoxSent.Text = "";
            this.Dispose();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }
    }
}

⌨️ 快捷键说明

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