Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8
This is the forum to discuss the Wrox book Visual Basic 2008 Programmer's Reference by Rod Stephens; ISBN: 9780470182628
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 27th, 2008, 01:24 AM
Registered User
 
Join Date: Oct 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Enter as a valid entry in a textbox (VB)

I am new to VB2008 and I am stuck. I am creating an automated entry form for a barcode printing program. The goal is to scan (via keyboard wedge type scanner) a barcode label format into a textbox and then have the user press enter (or have the enter keystroke embedded in the scanned barcode). Once the enter has been pressed/scanned I would like to have control of the textbox as I would with the on Click. How do I do this?

Thank you
  #2 (permalink)  
Old February 9th, 2009, 04:33 PM
Authorized User
 
Join Date: Dec 2008
Location: Keyport, NJ 07735
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Chr(13) Then
            MsgBox("Enter was pressed")
            'Now we need to stop the annoying ding
            e.KeyChar = Chr(1)
        End If
    End Sub
If this helps you please use the thanks button.
  #3 (permalink)  
Old February 9th, 2009, 04:37 PM
Authorized User
 
Join Date: Dec 2008
Location: Keyport, NJ 07735
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If Not InStr(TextBox1.Text, Chr(13)) = 0 Then MsgBox("Enter Key was sent to text box")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = "hello" & Chr(13)
    End Sub
If this helps you please use the thanks button.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date entry textbox as / / adamusufi SQL Server 2000 5 February 22nd, 2009 12:23 AM
TextBox entry validation thillai Visual Basic 2005 Basics 6 February 20th, 2008 07:23 AM
force a valid entry befor exiting Vince_421 Access VBA 7 June 22nd, 2006 09:52 AM
enter key on textbox, performs button event code?? squeakstar Visual Basic 2005 Basics 4 June 22nd, 2006 05:13 AM



All times are GMT -4. The time now is 11:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.