Numericupdown lock down

Asked

Viewed 107 times

-1

How to block or control the "Down" state of the Numericupdown component of Windows Forms ?

Ex: First time the user makes a "registration", he can Add or Remove the Quantity, in the second possibility the user can "edit" add or remove the added amount, as long as the Down is not less than the amount previously saved in the registration.

inserir a descrição da imagem aqui

  • 1

    has already taken a look at the documentation?

  • @Alvaroalves Yes, but at first I did not find a solution or I did not understand the documentation. That’s why the question here at Stackoverflow.

  • Edit your question and add what you’ve tried to do

  • @samuelrvg What do you mean by control? Do you want to change the "step" of it? For example: decrease 5 by 5, instead of 1 in 1

  • If I understand correctly he wants there to be only the option to increase - although this has not made sense to me, because if the user increases unintentionally, it will not be able to decrease.

  • @Andersoncarloswoss I thought it was this too, but then I fell for the same idea. It doesn’t make sense to have just one option.

  • @LINQ what I want is at a certain time "Register" it can change the normal value, both Up and Down, at another time for example "Edit" I want it to be only UP, thus blocking Down, makes sense now ?

  • I recommend you create a textbox and two buttons and do this customized.. according to your logic.. pq has nothing native to lock only down, unless you go to change Event and if the value is decreasing the current value you lock and do not leave ( e.Cancel )

  • You set the minimum value for the current quantity, does not solve?

  • https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.numericupdown.minimum?view=netframework-4.7.2

Show 5 more comments

2 answers

1


I think that in this your situation the best would be numericupdown to pull the saved data and play in your Numeric’s minimum option so the minimum will always be what the last saved user

1

I think this is what you want.

numericUpDown.ReadOnly = true;

Browser other questions tagged

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