I have seen programs using the NumericUpDown control that have a unit inside it (e.g. cm). Does anyone know how to do that?
Printable View
I have seen programs using the NumericUpDown control that have a unit inside it (e.g. cm). Does anyone know how to do that?
Are you referring to displaying "cm" in the box as well? If that's the case, then not to my knowledge, since only numbers can be entered into the box...
How do you know its a NumericUpDown control? Maybe its a ListBox made to look like a NUD control?
There is also the DomainUpDown, which you can attatch right to the side of a numericupdown and make it look like one control, just handle the changed event of the domainupdown to convert the numbers inside the numericupdown.
Bill
Or you could just use a DomainUpDown in the first place. If you populate it programtically it's very easy to have a large number of steps without having to painstakingly add each one yourself. You could probably create an inherited, owner-drawn NumericUpDown that would allow you to include a unit, or there might already be one created by someone else available. The Code Project is the first place I look for stuff like that.Quote:
Originally Posted by conipto