NumericUpDown ValueChanged

D

davebythesea

Hi,

I'm using a numericupdown in my app. The event ValueChanged fires when the
value is changed via the up down arrows. However, if I change the value by
editing the text directly, this event does not fire until I change focus to
another control.

Is it possible to disable the user from entering a value directly into the
numericupdown, and just confien them to using the up down arrows to change
the value?

Thanks again for any tips.
Dav
 
S

Simon Hart [MVP]

No this is not possible. You'd have to write your own control which wouldn't
be that difficult when using CF 2.0 or onwards. You could create a panel with
a text box then draw two custom buttons up and down arrow maybe use icons
here then you can control anything you like. This would be considered a
composite control.
 
J

Jayesh

No this is not possible. You'd have to write your own control which wouldn't
be that difficult when using CF 2.0 or onwards. You could create a panel with
a text box then draw two custom buttons up and down arrow maybe use icons
here then you can control anything you like. This would be considered a
composite control.

Hi,

If I understood your problem correctly, you want to disable direct
entry into edit box and force to use up/down buttons only.
You can set NumericUpDown.ReadOnly (Gets or sets a value indicating
whether the text can be changed by the use of the up or down buttons
only) property.
I am using .NET CF 3.5, not sure if this property available on older
CF.
Let me know if this is what you were looking for.

Thanks,
Jayesh Modha
 
D

davebythesea

Jayesh said:
Hi,

If I understood your problem correctly, you want to disable direct
entry into edit box and force to use up/down buttons only.
You can set NumericUpDown.ReadOnly (Gets or sets a value indicating
whether the text can be changed by the use of the up or down buttons
only) property.
I am using .NET CF 3.5, not sure if this property available on older
CF.
Let me know if this is what you were looking for.

Thanks,
Jayesh Modha

That was exactly what I was looking for!

Thank you both for your replies.

David
 

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