How to start a textbox with a value of 0 (zero)?

Asked

Viewed 836 times

2

I have a form created with Windows Forms, and in this form I have textbox who will receive numbers.

How do I make this textbox, when initializing, is already filled with value 0, that is when I open the form, the textbox already load with value 0, but it is possible for me to change to another value later?

  • Putting the value 0 on it. How to do this depends on your code that has not been placed.

1 answer

3


At the event

Form_Load()

You put:

seuTextbox.Text = "0";

As mentioned in the comment of Renan Silveira you can do so:

inserir a descrição da imagem aqui

  • 1

    I can’t answer that, but that’s the right answer. Or vc goes in the Field properties and in "Text" you put 0 to open already with value. Has case you wanted to receive only number uses the field "Maskedtextbox, and in the properties puts only number and a start value works best for you limit only numeric value

  • 1

    Thank you very much gave it right here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.