如何获得条形码输入? [英] How to get barcode input ?

查看:130
本文介绍了如何获得条形码输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好每一个

i我是编程的新手。我想做一些任务。但是我不知道如何在2015年的Visual Studio社区中用c#,winform来做这件事。

1)我有2个文本框的形式和1个datagridview

2)在datagridview我有2列第1个是条形码,第二个是价格

3)我想扫描条形码用usb条码扫描器到文本框1

扫描后第一个条形码我想条形码到datagridview条形码栏1

4)扫描后我想要textbox1清除,并且聚焦改变在textbox2中键入输入后,用户按下回车键,文本传递到datagridview price column2,清除textbox2,焦点改为文本框1。


5) />
6)在按钮的帮助下完成这项任务。



如果有人知道如何完成这项任务

请一步一步解释我



并感谢提前帮助:)



我尝试了什么:



i尝试过表格对象,但我找到的所有东西都要求添加按钮以形成

我想要它没有按钮。

hello every one
i am new to programing .and i want to do some task.but i cant understand how to do it in visual studio community 2015,with c#,winform.
1) i have form with 2 text box and 1 datagridview
2) in datagridview i have 2 column 1st is barcode and second is price
3) i want to scan barcode with usb barcode Scanner to textbox1
after scaning first barcode i want that barcode to datagridview barcode column1
4) after scanning i want textbox1 clear, and focuse change to textbox2.
5) after typing input in textbox2 user press enter key and text pass to datagridview price column2,and clear textbox2 with focus changing to text box1.

6) doing this task with out help of button .

if any one has idea how to complete this task
please explain me step by step

and thanks for helping in advance :)

What I have tried:

i tried table object but all things i found ask for add button to form
and i want it without button.

推荐答案

基本上,我们可以' t - 大多数USB扫描仪配置为像键盘一样运行,因此每次用户扫描项目时,它看起来就像是在键盘上键入文章编号,没有办法说出来。大多数扫描仪可以配置为提供扫描开始和扫描结束字符或序列,但确切地说,配置单元以提供它的方式和方式因制造商而异,并且通常因型号而异。因此,首先与扫描仪制造商交谈,看看他们说了什么 - 许多人还提供代码示例,这些代码示例将为您提供一个基础。

我用start配置它结束序列和工作,可能在TextBox.KeyPress事件中。

ENTER键是另一个问题:它通常被表格捕获并用于激活按钮 - 所以你需要也可以做一些事情。

对于一个完整的初学者来说,这不是一项微不足道的任务 - 但如果你有一些经验,你应该能够完成它。如果你不这样做,那么我强烈建议你在尝试这样做之前需要掌握基础知识。从随机项目示例中学习是一种非常糟糕的学习方法 - 你会错过很多东西!
Basically, we can't - most USB scanners are shipped configured to act like a keyboard, so each time the user scans an item it looks just like they typed the article number in on the keyboard, there is no way to tell. Most scanners can be configured to provide a "start of scan" and "end of scan" character or sequence but exactly what and how you configure the unit to provide it will vary from manufacturer to manufacturer and often from model to model. So start by talking to the scanner manufacturer and see what they say - many also provide code samples which will give you a "base" for starting from.
I'd configure it with a "start" and "end" sequence and work from that, probable in the TextBox.KeyPress event.
The ENTER key is another problem: it is normally trapped by the Form and used to activate a Button - so you will need to do something about that as well.
For a complete beginner, this isn't a trivial task - but if you have some experience you should be able to complete it. If you don't, then I'd strongly suggest you need to get solid experience with the basics before trying to do this. Learning from random project examples is a pretty bad way to learn - you will miss a heck of a lot!


这篇关于如何获得条形码输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆