Bagaimana cara agar angka 0 pada keyboard tidak masuk ke textbox

How about when we press the number 0 on the keyboard it is not displayed in the textbox?

Are you working in the Designer?
Is the 0 key in the numeric keypad on the right of your keyboard?
If so, you might have to use the NUM LOCK key further up to switch the keyboard to numbers.

Apakah ada contohnya dari blok?

I want the number 0 not to be input to the textbox.

You could run a fast repeating Clock Timer to check if the input.Text contains '0', then replace '0' with empty text in the textbox.Text

A replacement will have the unfortunate side effect of moving the cursor of the textbox.

Another alternative would be to code your own numeric keyboard for that input textbox, button by button, and flash a fake cursor in the textbox.Text field.

is it possible if we press the number 0 on the keyboard, a notification will appear?

Yes, if you run a fast Clock Timer to check if the textbox.Text contains '0'.
Check in the Clock.Timer event.

1 Like

you might want to try the textbox extension and its AfterTextChanged event

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

how to remove the number 0 on the keyboard or if the number 0 is pressed not to input to the textbox. This aims to send password data to Arduino. and the password cannot be 0.

if you use the textbox extension and its AfterTextChanged event (alternatively a fast running clock component as @ABG suggested) you would use an if statement like this

if Textbox.Text = 0
then Textbox.Text = "" (empty string)

Taifun

1 Like

Or even this -
Under the AfterTextChanged event in @Taifun's extension, you can add this,

image

1 Like

@aris_syetiawan I have two ways you can use, Look at this :

Aia Project :
NewProject.aia (2.1 KB)

1 Like

this is what I'm looking for, thank you very much for your help.

1 Like

You're welcome @aris_syetiawan, if your problem has been resolved please close this topic by pressing the solution button, so other people who have problem like you can learn from the topic you create.
Thank you :kissing_heart:

1 Like

where is the solution button?
I didn't find the solution button

1 Like

okay you've pressed it, thank you :star_struck: :kissing_heart:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.