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. General Programming
  3. C#
  4. Custom look for NumericUpDown control

Custom look for NumericUpDown control

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 2 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.
  • M Offline
    M Offline
    Mazdak
    wrote on last edited by
    #1

    I want to change the look of Up and Down buttons in NumericUpDown control with some images, I know one way is to override OnPaint event but I could not find any example. Does anyone know good example of this?

    Mazy
    "This chancy chancy chancy world."

    OriginalGriffO 1 Reply Last reply
    0
    • M Mazdak

      I want to change the look of Up and Down buttons in NumericUpDown control with some images, I know one way is to override OnPaint event but I could not find any example. Does anyone know good example of this?

      Mazy
      "This chancy chancy chancy world."

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

      Hoo Hoo! That's not an easy one. NumericUpDown is a composite control, it contains a text box and a button box - but it doesn't make either public. You can get at the contents (I believe, I've never tried) with reflection, but to be honest, you would be relying on class internals that you have no guarantee will remain the same. I.e. your code may work today, but tomorrow... A better solution would be to create your own custom control that looks the way you need, including your own up/down logic and text box. Would be more reliable, and probably quicker to develop, too.

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

      "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

      M 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Hoo Hoo! That's not an easy one. NumericUpDown is a composite control, it contains a text box and a button box - but it doesn't make either public. You can get at the contents (I believe, I've never tried) with reflection, but to be honest, you would be relying on class internals that you have no guarantee will remain the same. I.e. your code may work today, but tomorrow... A better solution would be to create your own custom control that looks the way you need, including your own up/down logic and text box. Would be more reliable, and probably quicker to develop, too.

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

        M Offline
        M Offline
        Mazdak
        wrote on last edited by
        #3

        Yes, after more investigation, I came into same result. Thanks for reply.

        Mazy
        "This chancy chancy chancy world."

        OriginalGriffO 1 Reply Last reply
        0
        • M Mazdak

          Yes, after more investigation, I came into same result. Thanks for reply.

          Mazy
          "This chancy chancy chancy world."

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

          Welcome - good luck!

          Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

          "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

          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