Custom look for NumericUpDown control
-
-
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."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.
-
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.
-
Yes, after more investigation, I came into same result. Thanks for reply.
Mazy
"This chancy chancy chancy world."Welcome - good luck!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.