Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 6 - 8
BSD 3-Clause "New" or "Revised" License
401 stars 61 forks source link

[Feature Request]: Add `KryptonNumericUpDown` AutoSize property, and auto change when min / max values change #667

Open giduac opened 2 years ago

giduac commented 2 years ago

Is your feature request related to a problem? Please describe. KryptonNumericUpDown & KryptonDomainUpDown have no AutoSize property. The standard Winforms equivalents have.

Describe the solution you'd like Please, make the property available like in the standard control.

Additional context NumericUD: Sizing the property by hand/mouse in the designer is not possible.

Smurf-IV commented 2 years ago

@giduac When I place a normal Winform NumericUD on a form and set the AutoSize=true, and run, Nothing happens to the size of the element. What do you expect to happen ?

image

giduac commented 2 years ago

Hi @Smurf-IV ,

What I thought is that when autosize is on the control re-adjusts it's width when the inner text becomes larger than the visible area.

I obviously didn't test this when I posted this FR. But have done so now. The winforms nud has the autosize property but does not react to it when the text/number becomes out of bounds. This also goes for the DomainUD.

So this FR can be closed.

Smurf-IV commented 2 years ago

Thanks for confirming.

giduac commented 2 years ago

Hi @Smurf-IV ,

I've been having deeper look at this and it actually does work but in a different way than you would intuitively expect. The Krypton versions lack this behaviour.

I'll post a sample app with findings here later on and we can see what kind of FR(S) to create from this or let things be as they are...

giduac commented 2 years ago

Hi @Smurf-IV ,

Findings below. I used videos which illustrate things better imo.

Tested with net48/50/60

Winforms DUD & NUD

Winforms NUD:

Winforms DUD

Out of scope but a bug in .NET (net48/50/60 tested) and will file a bug request with them:

Possible FRs

Resizing the KryptonNUD in the designer (possibly a separate Bug ticket):

Videos

  1. NUD AutoSize behaviour
  2. DUD AutoSize behaviour
  3. NUD Resizing visually in the designer

https://user-images.githubusercontent.com/96108132/176381568-33a992e2-2f7f-4de2-aa2f-3c4838a18868.mp4

https://user-images.githubusercontent.com/96108132/176381627-314a2f7b-b47e-4cf1-9155-5aa78095793d.mp4

https://user-images.githubusercontent.com/96108132/176381652-ee0b813e-5af9-4578-8123-5ba70a28be4e.mp4

Smurf-IV commented 2 years ago

Resizing the KryptonNUD in the designer (possibly a separate Bug ticket):

Is not possible although the grip on the right and left is visible. If the left grip is dragged the control is moved. If the right is dragged nothing happens

This "should" have been sorted via a separate bug a little while ago.

Smurf-IV commented 2 years ago

Might be automated through a change of the maximum property and triggered if AutoSize == True

The "Auto Display Width" also needs to alter if the minimum string is also longer than the max string !

Smurf-IV commented 2 years ago

@giduac Refocusing this "Title" to the work that will need to be done.

Smurf-IV commented 2 years ago

Note: This one is not going to be easy, due to the designer issues, and the use of min size will need to be "Turned on" if AutoSize = true

giduac commented 2 years ago

@Smurf-IV

Nice.

Btw: do you want an extra bug ticket for the KNUD to fix resizing in the designer (3rd video) ? ...

Smurf-IV commented 2 years ago

Btw: do you want an extra bug ticket for the KNUD to fix resizing in the designer (3rd video) ? ...

No, It's not a problem, in the alpha branch that I have from 2022-06-25, I'm about to get Latest alpha, and check

Smurf-IV commented 2 years ago

No, It's not a problem, in the alpha branch that I have from 2022-06-25, I'm about to get Latest alpha, and check

It's "Still" okay ;-) NUD_DesignerDrag

giduac commented 2 years ago

Hi @Smurf-IV

Confirming the above fix in Nightly: 70.22.7.200-alpha

giduac commented 4 months ago

@Wagnerp,

Please assign to me. TY.

PWagner1 commented 4 months ago

@giduac Done

giduac commented 3 months ago

@Wagnerp Please tag with the V100 label

Smurf-IV commented 3 months ago

Hmm, I think this should be a v90, due to its age, and the fact it's a missing (Because it's a winform feature)

giduac commented 3 months ago

Hmm, I think this should be a v90, due to its age, and the fact it's a missing (Because it's a winform feature)

It's not part of Winforms it's actually a shortcoming within winforms. Therefore a FR for Krypton.