Click here to Skip to main content
15,895,962 members
Home / Discussions / C#
   

C#

 
Questionevents adding and removing Pin
netJP12L10-Jul-08 5:49
netJP12L10-Jul-08 5:49 
AnswerRe: events adding and removing Pin
Thomas Stockwell10-Jul-08 10:35
professionalThomas Stockwell10-Jul-08 10:35 
AnswerRe: events adding and removing Pin
PIEBALDconsult10-Jul-08 11:33
mvePIEBALDconsult10-Jul-08 11:33 
Questionmessagebox does not stop [modified] Pin
scalpabob10-Jul-08 5:47
scalpabob10-Jul-08 5:47 
AnswerRe: message box does not stop Pin
DaveyM6910-Jul-08 8:35
professionalDaveyM6910-Jul-08 8:35 
GeneralRe: messagebox does not stop [modified] Pin
scalpabob10-Jul-08 20:36
scalpabob10-Jul-08 20:36 
GeneralRe: messagebox does not stop [modified] Pin
scalpabob11-Jul-08 3:38
scalpabob11-Jul-08 3:38 
GeneralRe: messagebox does not stop Pin
DaveyM6914-Jul-08 12:20
professionalDaveyM6914-Jul-08 12:20 
Sorry for the delay in responding - I've only just checked this thread!

I stripped your code a little so I could just run it on a form with one textbox and it works fine!
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
   try
   {
      if (e.KeyChar == (char)Keys.Return) // Catch carriage return from barcode
      {
         e.Handled = true;
         if (validate_data(textBox1.Text.Trim()) == false)
         {
            this.textBox1.Enabled = false;
            switch (MessageBox.Show(" BarCode does not match, Accept BarCode ?",
               "Validate BarCode", MessageBoxButtons.YesNo,
               MessageBoxIcon.Question,
               MessageBoxDefaultButton.Button1))
            {
               case DialogResult.Yes:
                  break;
               case DialogResult.No:
                  break;
            }
         }
      }
   }
   catch (Exception z)
   {
      MessageBox.Show("Error in btnOpenSort_Click" + z);
   }
}

private Boolean validate_data(string scannedData)
{
   return false;
}

Have you tested it just inputting data using the keyboard? If it works for you that way you need to look into the configuration codes for the scanner.

Dave

GeneralRe: messagebox does not stop Pin
scalpabob17-Aug-08 22:16
scalpabob17-Aug-08 22:16 
GeneralRe: messagebox does not stop Pin
DaveyM6918-Aug-08 8:11
professionalDaveyM6918-Aug-08 8:11 
Questionxml Pin
arkiboys10-Jul-08 5:03
arkiboys10-Jul-08 5:03 
AnswerRe: xml Pin
Ravi Bhavnani10-Jul-08 6:20
professionalRavi Bhavnani10-Jul-08 6:20 
QuestionRead specific cells in Excel Pin
kallileo10-Jul-08 4:47
kallileo10-Jul-08 4:47 
AnswerRe: Read specific cells in Excel Pin
led mike10-Jul-08 4:54
led mike10-Jul-08 4:54 
QuestionDetect NULL values before trying to AVG data Pin
scjsb10-Jul-08 4:15
scjsb10-Jul-08 4:15 
AnswerRe: Detect NULL values before trying to AVG data Pin
vkuttyp10-Jul-08 5:05
professionalvkuttyp10-Jul-08 5:05 
QuestionProblem Starting Windows Service Automatically Pin
karthi8410-Jul-08 3:45
karthi8410-Jul-08 3:45 
AnswerRe: Problem Starting Windows Service Automatically Pin
PIEBALDconsult10-Jul-08 4:03
mvePIEBALDconsult10-Jul-08 4:03 
GeneralRe: Problem Starting Windows Service Automatically Pin
karthi8411-Jul-08 3:06
karthi8411-Jul-08 3:06 
AnswerRe: Problem Starting Windows Service Automatically Pin
DaveyM6910-Jul-08 8:44
professionalDaveyM6910-Jul-08 8:44 
GeneralRe: Problem Starting Windows Service Automatically Pin
karthi8411-Jul-08 3:06
karthi8411-Jul-08 3:06 
QuestionValue in long pointer resets after a stackalloc Pin
Campden BRI Developers10-Jul-08 3:34
Campden BRI Developers10-Jul-08 3:34 
QuestionConcept of digital signing -help Pin
Emil Müller10-Jul-08 3:30
Emil Müller10-Jul-08 3:30 
AnswerRe: Concept of digital signing -help Pin
Simon P Stevens10-Jul-08 3:40
Simon P Stevens10-Jul-08 3:40 
QuestionApplying a filter to a dataset Pin
Andres Coder10-Jul-08 2:57
Andres Coder10-Jul-08 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.