I’m using visual studio and have some numericUpDown controls that I have set values for (min, max, value and increment). The Code Designer keeps turning my simple decimal values into int[]. I know that it says “do not modify the contents of this method with the code editor” but I find it really useful to adjust properties in here and I thought I was just “making things neat” when I changed:
this.numericUpDown1.Increment = new decimal(new int[] {
2,
0,
0,
0});
to
this.numericUpDown1.Increment = new decimal(2);
but alas, it changes it back if I touch the control on the visual form designer. I thought maybe there was a flag that would leave it as is until I want it to be updated. It is more for readability and navigation but even if it would just leave it on one line I’d be happier.
I’ve found this (How can I tell Visual Studio to not populate a field in the designer code?) where someone was trying to leave it but I’m not sure if it is applicable in this instance.
Feel free to tell me that I should just get over it and leave it alone!
Just realised (thanks @Jonathan) that I could just create a separate section in the designer ABOVE that place … this means I can have all my default values in a separate section as long as I don’t want to changed the defaults on the form designer. This is the method above InitializeComponent()