Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Custom Flat-style Numeric UpDown Control

Custom Flat-style Numeric UpDown Control

Scheduled Pinned Locked Moved The Lounge
csharpdotnetwinformscom
13 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RickZeeland
    wrote on last edited by
    #1

    For those looking for an alternative to the standard Winforms numeric UpDown Control, I made a Custom Flat-style Numeric UpDown Control that functions largely the same but does not have those pesky tiny buttons. The real reason for developing this however was that in some of our (complicated) forms in .NET 6 the standard numeric UpDown Control behaved very badly when changing the font size of the form and sometimes completely disappeared :~ It can be downloaded here: GitHub - A Custom Numeric UpDown Control[^]

    OriginalGriffO P L B 4 Replies Last reply
    0
    • R RickZeeland

      For those looking for an alternative to the standard Winforms numeric UpDown Control, I made a Custom Flat-style Numeric UpDown Control that functions largely the same but does not have those pesky tiny buttons. The real reason for developing this however was that in some of our (complicated) forms in .NET 6 the standard numeric UpDown Control behaved very badly when changing the font size of the form and sometimes completely disappeared :~ It can be downloaded here: GitHub - A Custom Numeric UpDown Control[^]

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      An article or tip is probably a better place to put this?

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      R 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        An article or tip is probably a better place to put this?

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        R Offline
        R Offline
        RickZeeland
        wrote on last edited by
        #3

        Exactly! but it still needs some work I think, so when it's finished (and I have some time left) it will become a tip :-\

        1 Reply Last reply
        0
        • R RickZeeland

          For those looking for an alternative to the standard Winforms numeric UpDown Control, I made a Custom Flat-style Numeric UpDown Control that functions largely the same but does not have those pesky tiny buttons. The real reason for developing this however was that in some of our (complicated) forms in .NET 6 the standard numeric UpDown Control behaved very badly when changing the font size of the form and sometimes completely disappeared :~ It can be downloaded here: GitHub - A Custom Numeric UpDown Control[^]

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          What I would want in a NumericUpDown is the ability to set a factor for the up and down buttons rather than adding/subtracting a value, multiply/divide by the factor. So, for instance, I can set it to double/halve the value. On the other hand, I have only one place I want that, so it's not a high priority for me.

          O R 0 3 Replies Last reply
          0
          • P PIEBALDconsult

            What I would want in a NumericUpDown is the ability to set a factor for the up and down buttons rather than adding/subtracting a value, multiply/divide by the factor. So, for instance, I can set it to double/halve the value. On the other hand, I have only one place I want that, so it's not a high priority for me.

            O Offline
            O Offline
            obermd
            wrote on last edited by
            #5

            With this custom control you could do just that.

            1 Reply Last reply
            0
            • P PIEBALDconsult

              What I would want in a NumericUpDown is the ability to set a factor for the up and down buttons rather than adding/subtracting a value, multiply/divide by the factor. So, for instance, I can set it to double/halve the value. On the other hand, I have only one place I want that, so it's not a high priority for me.

              R Offline
              R Offline
              RickZeeland
              wrote on last edited by
              #6

              Should not be too difficult to implement, just clone the GitHub repo and add a new property named Factor, if it has a value use it in the AddValue() method :-\

              1 Reply Last reply
              0
              • R RickZeeland

                For those looking for an alternative to the standard Winforms numeric UpDown Control, I made a Custom Flat-style Numeric UpDown Control that functions largely the same but does not have those pesky tiny buttons. The real reason for developing this however was that in some of our (complicated) forms in .NET 6 the standard numeric UpDown Control behaved very badly when changing the font size of the form and sometimes completely disappeared :~ It can be downloaded here: GitHub - A Custom Numeric UpDown Control[^]

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                I've started using semi-opaque backgrounds (UWP) on my app's "tool boxes" (user controls). The buttons (with icons) reflect the transparency while the icons remain fully opaque. It actually works (with a border); the visuals behind can be made out (a topo map in this case) so you don't have to scroll or drag things out of the way. Like a HUD. Probably "gained" 25% screen space. A different experience.

                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                B 1 Reply Last reply
                0
                • P PIEBALDconsult

                  What I would want in a NumericUpDown is the ability to set a factor for the up and down buttons rather than adding/subtracting a value, multiply/divide by the factor. So, for instance, I can set it to double/halve the value. On the other hand, I have only one place I want that, so it's not a high priority for me.

                  0 Offline
                  0 Offline
                  0x01AA
                  wrote on last edited by
                  #8

                  A factor? Or maybe increment/decrement the digit on which the cursor is?

                  P 1 Reply Last reply
                  0
                  • 0 0x01AA

                    A factor? Or maybe increment/decrement the digit on which the cursor is?

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    Ooooohhhhhh...

                    1 Reply Last reply
                    0
                    • L Lost User

                      I've started using semi-opaque backgrounds (UWP) on my app's "tool boxes" (user controls). The buttons (with icons) reflect the transparency while the icons remain fully opaque. It actually works (with a border); the visuals behind can be made out (a topo map in this case) so you don't have to scroll or drag things out of the way. Like a HUD. Probably "gained" 25% screen space. A different experience.

                      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                      B Offline
                      B Offline
                      BillWoodruff
                      wrote on last edited by
                      #10

                      Please post an article on this.

                      «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                      L 1 Reply Last reply
                      0
                      • R RickZeeland

                        For those looking for an alternative to the standard Winforms numeric UpDown Control, I made a Custom Flat-style Numeric UpDown Control that functions largely the same but does not have those pesky tiny buttons. The real reason for developing this however was that in some of our (complicated) forms in .NET 6 the standard numeric UpDown Control behaved very badly when changing the font size of the form and sometimes completely disappeared :~ It can be downloaded here: GitHub - A Custom Numeric UpDown Control[^]

                        B Offline
                        B Offline
                        BillWoodruff
                        wrote on last edited by
                        #11

                        In your spare time ? Alt + up/down ... +- by factor #1 Control up/down... +- by factor #2 Then handle Alt + Control and right/left key variations :)

                        «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                        R 1 Reply Last reply
                        0
                        • B BillWoodruff

                          In your spare time ? Alt + up/down ... +- by factor #1 Control up/down... +- by factor #2 Then handle Alt + Control and right/left key variations :)

                          «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                          R Offline
                          R Offline
                          RickZeeland
                          wrote on last edited by
                          #12

                          Nice suggestions, but my problem is where to find the time, we are in the midst of a very time consuming upgrade from .NET 4.8 to .NET 6, and so far it hasn't exactly been a smooth ride (due the complex nature of our main application).

                          1 Reply Last reply
                          0
                          • B BillWoodruff

                            Please post an article on this.

                            «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            It sounds complicated but it's just using an "acrylic" Brush (available in UWP) instead of a regular "solid color brush" for the background. The same facility can be added to WPF using the "community tool kit". Or you can fake it varying the opacity of the background of a control ... though the "acrylic" brush seems to be a bit more "glassy".

                            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups