• 大小: 441KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-18
  • 语言: C#
  • 标签: C#实现类  

资源简介

VS2017中C#实现类似工业触摸屏的数字软键盘,应用在工控机PC替代工业触摸屏。此资源包含数字软键盘的最小值和最大值。参考工业触摸屏数字键盘来开发的。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Numkeyboard
{
    public partial class Form1 : Form
    {
        public int keyBoardNumberResult;
        public float keyBoardNumberResultF;
        public Form1()
        {
            InitializeComponent();
        }
        //键盘显示函数
        public bool keyBoardNumberDisplay(string old int keyDecimal int min int max int x int y)
        {
            //beep();
            KeyBoardNumber dlg = new KeyBoardNumber();
            dlg.keyBoardOld = old;
            dlg.keyBoardDecimal = keyDecimal;
            dlg.keyBoardMin = min;
            dlg.keyBoardMax = max;
            Point pt = new Point();
            pt.X = x;
            pt.Y = y;
            dlg.Location = pt;
            dlg.F1 = this;
            if (dlg.ShowDialog() == DialogResult.OK)//判断数字输入框是否完成
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        //调用软键盘窗口
        private void textBoxNum_Click(object sender EventArgs e)
        {
            if (keyBoardNumberDisplay(textBoxNum.Text 0 0 1000 400 200))
                textBoxNum.Text = keyBoardNumberResult.ToString();
        }
        //禁用物理键盘
        private void textBoxNum_KeyPress(object sender KeyPressEventArgs e)
        {
            e.Handled = true;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-04 19:01  Numkeyboard\
     目录           0  2018-06-04 11:15  Numkeyboard\.vs\
     目录           0  2018-06-04 11:15  Numkeyboard\.vs\Numkeyboard\
     目录           0  2018-06-04 11:16  Numkeyboard\.vs\Numkeyboard\v15\
     文件       35328  2018-06-04 19:00  Numkeyboard\.vs\Numkeyboard\v15\.suo
     目录           0  2018-06-04 11:16  Numkeyboard\.vs\Numkeyboard\v15\Server\
     目录           0  2018-06-04 11:16  Numkeyboard\.vs\Numkeyboard\v15\Server\sqlite3\
     文件           0  2018-06-04 11:16  Numkeyboard\.vs\Numkeyboard\v15\Server\sqlite3\db.lock
     文件      602112  2018-06-04 18:28  Numkeyboard\.vs\Numkeyboard\v15\Server\sqlite3\storage.ide
     文件       32768  2018-06-04 11:16  Numkeyboard\.vs\Numkeyboard\v15\Server\sqlite3\storage.ide-shm
     文件     4136512  2018-06-04 19:03  Numkeyboard\.vs\Numkeyboard\v15\Server\sqlite3\storage.ide-wal
     目录           0  2018-06-04 19:00  Numkeyboard\Numkeyboard\
     文件         189  2018-06-04 11:15  Numkeyboard\Numkeyboard\App.config
     文件        2963  2018-06-04 19:00  Numkeyboard\Numkeyboard\Form1.Designer.cs
     文件        1669  2018-06-04 19:00  Numkeyboard\Numkeyboard\Form1.cs
     文件        5817  2018-06-04 19:00  Numkeyboard\Numkeyboard\Form1.resx
     文件       15677  2018-06-04 17:19  Numkeyboard\Numkeyboard\KeyBoardNumber.Designer.cs
     文件        8774  2018-06-04 18:52  Numkeyboard\Numkeyboard\KeyBoardNumber.cs
     文件        5817  2018-06-04 17:19  Numkeyboard\Numkeyboard\KeyBoardNumber.resx
     文件        4076  2018-06-04 16:06  Numkeyboard\Numkeyboard\Numkeyboard.csproj
     文件         523  2018-06-04 11:15  Numkeyboard\Numkeyboard\Program.cs
     目录           0  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\
     文件        1344  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\AssemblyInfo.cs
     文件        2835  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\Resources.Designer.cs
     文件        5612  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\Resources.resx
     文件        1098  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\Settings.Designer.cs
     文件         249  2018-06-04 11:15  Numkeyboard\Numkeyboard\Properties\Settings.settings
     目录           0  2018-06-04 11:15  Numkeyboard\Numkeyboard\bin\
     目录           0  2018-06-04 17:26  Numkeyboard\Numkeyboard\bin\Debug\
     文件       68608  2013-06-27 20:47  Numkeyboard\Numkeyboard\bin\Debug\DevComponents.DotNetBar.Keyboard.dll
     文件       65293  2013-06-25 14:12  Numkeyboard\Numkeyboard\bin\Debug\DevComponents.DotNetBar.Keyboard.xml
............此处省略22个文件信息

评论

共有 条评论

相关资源