Re: How to create an automated input box.
- From: cmdolcet69 <colin_dolcetti@xxxxxxxxxxx>
- Date: Sat, 5 Jan 2008 19:11:02 -0800 (PST)
On Jan 4, 5:06 pm, "Armin Zingler" <az.nos...@xxxxxxxxxx> wrote:
"cmdolcet69" <colin_dolce...@xxxxxxxxxxx> schrieb
I have the code below that will evaluate a string of characters. If
its less then 12 long it will trigger a message box if its equal it
will save the information and close the form.
I have this currectly on a button event, how could i place this same
logic say once i enter in my last character it will trigger the
logic written in the button control.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.Click
If Len(Me.txtBarCode.Text) = 12 Then
_barcode = Me.txtBarCode.Text
Close()
Else
MessageBox.Show("The Current BarCode Scanned was not
correct, Please Re Enter")
Me.txtBarCode.Text = String.Empty
txtBarCode.Focus()
End If
End Sub
Move the code from Button1_Click into a new sub. Call the sub in the Click
handler and additionally in the Textbox' TextChanged event. (But, as a user,
I would like to be able to edit the text I entered until I pressed the
button.)
Armin- Hide quoted text -
- Show quoted text -
Armin, if i move the code or create another sub and place it under the
text change event. Each time i enter a number i get the message box
because the text change event is evaluating it each time.
.
- Follow-Ups:
- Re: How to create an automated input box.
- From: Zebra Code
- Re: How to create an automated input box.
- From: Jack Jackson
- Re: How to create an automated input box.
- From: Cor Ligthert[MVP]
- Re: How to create an automated input box.
- References:
- How to create an automated input box.
- From: cmdolcet69
- Re: How to create an automated input box.
- From: Armin Zingler
- How to create an automated input box.
- Prev by Date: Re: Clearing Keyboard Buffer
- Next by Date: Re: Array Function
- Previous by thread: Re: How to create an automated input box.
- Next by thread: Re: How to create an automated input box.
- Index(es):