This code doesn't work if i set the value of the textbox to 1, with a minimum of 1.
numStartChannel.Minimum = 1;
numStartChannel.ResetText();
numStartChannel.Value = 1;
The control actually has the correct value internally, but still displays blank on the form. Note that the reset is actually ran in a click event, not directly before the value setting.
This code DOES work, but I don't know why.
numStartChannel.Minimum = 1;
numStartChannel.ResetText();
numStartChannel.Value = 2;
numStartChannel.Value = 1;
And finally, this code doesn't work:
numStartChannel.Minimum = 1;
numStartChannel.ResetText();
numStartChannel.Value = 1;
numStartChannel.Value = 1;
Can anyone explain this behavior? C# Visual Studio 2022.
ResetText()?numStartChannel.Minimum = 1; numStartChannel.Value = 1;is enough. TheTextis irrelevant, what matters in a NUD is theValue. Describe a little better the context of this operation and post some code that can reproduce the issue. E.g., is databindings involved? Did you bind theTextproperty?Minimum,MaximumandValueand they will take care of theTextas well. You don't need to callResetTextor set theTextof the control.