Override NumericUpDown Class?

R

ReMEN

---------
I posted this on another newsgroup on MS as well, maybe I
can get other opinions here as well
---------

Hi,

I posted on here before about using other characters than
integers in a
NumericUpDown control. The responses I got were pertaining
to unmanaged code.
My project is managed c++ and this is what I need some
help with.

Basically instead of displaying a two digit number in my
numericupdown, i
want to separate each digit by a character such as a " ' "
or a " | ". I
recently did some searching and came up with this. On MSDN
I can see the
class for the NumericUpDown controls for .NET:

public __gc class NumericUpDown : public UpDownBase { };

Is there a way I can "redefine" a NumericUpDown class for
my NumericUpDown
control? After reading, I see that the "UpButton"
and "DownButton" are the
methods invoked when the user clicks the according arrow
on the NumericUpDown
control.

I do not want to validate my NumericUpDown for integers, I
would like to
basically write my own code for the "UpButton"
and "DownButton" functions in
the class for NumericUpDown. I figure this way I can
perform my own
calculation for what actually goes into the NumericUpDown
value.

So instead of for instance, " 62 " in my NUD control. I
want it to say " 6'2 "

Any way this can be done is managed c++?
 
W

Wayne

Have you looked at the DomainUpDown? This allows you to add a list of Items
and it will cycle through them for you as the user presses the buttons.

--
Thanks
Wayne Sepega
Jacksonville, Fl


"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
G

Guest

I have looked at the domain control. However, it does not seem to me, to be
sensible to have to populate it with values generated by me.

Is there any way I can replace a method inside a NumericUpDown class with my
own?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top