Entering text without a textbox.

S

Shawn

I have an application that will use barcode scanners to enter an ID to
search a database. The main form uses a tab page. I would like people to go
to the tab for checking in and just read the barcode without having to hit
enter. I also want to keep the number hidden, so I don't want it entered
into a visible textbox. TabPages don't have a keypress event, so I'm not
sure how to handle this.

Thanks...
 
C

Charles Law

Hi Shawn

The barcode readers I have worked with have always passed the barcode data
to the program as if it had been typed at the keyboard, with a configurable
'end-of-entry' character; usually CR.

If this is the same in your case, you will need to have some control on your
tab page capable of receiving keyboard entry, and it must have the focus.
The most common control for this purpose is the TextBox control.

If you want to keep the number hidden, you could use a TextBox control with
the password character set. Also, have a default button that will accept the
CR.

HTH

Charles
 
S

Shawn

Thanks Charles,

Well, that was a way I knew I could do it, but I wanted to avoid having any
control showing on the form. Think of like a grocery store scanner. You wave
the UPC in front of the scanner and the item is retrieved from the database
without showing the input.
 
L

Larry Lard

(warning: horrible trick follows)

If you set a TextBox to MultiLine = True, you can then change its
Height to 0. In this state it is completely invisible, though it still
receives input focus and keyboard input as normal.
 
M

Mark Jerde

Larry said:
(warning: horrible trick follows)

If you set a TextBox to MultiLine = True, you can then change its
Height to 0. In this state it is completely invisible, though it still
receives input focus and keyboard input as normal.

LOL! I'm adding that to my bag of tricks. Thanks.

IIRC in VB5/6 I positioned controls off the left side of the form to do
similar. I haven't had the need yet in .NET so I haven't tried anything...

-- Mark
 
S

Shawn

That worked great!!! Thanks.

Mark Jerde said:
LOL! I'm adding that to my bag of tricks. Thanks.

IIRC in VB5/6 I positioned controls off the left side of the form to do
similar. I haven't had the need yet in .NET so I haven't tried
anything...

-- Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top