473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Characters in a NumericUpDown

Didn't find much documentation on value formatting on a NumericUpDown
control. is it possible to separate numbers by a special character.

For example, If I wanted to display an option to change a person's height in
a NumericUpDown, I would not want them to see 62, I'd want them to see 6'2"
(6-Foot-Two).

Is this even possible?

Thankyou,
Nov 17 '05 #1
2 1261
"ReMEn" <Re***@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
Didn't find much documentation on value formatting on a NumericUpDown
control. is it possible to separate numbers by a special character.

For example, If I wanted to display an option to change a person's height in a NumericUpDown, I would not want them to see 62, I'd want them to see 6'2" (6-Foot-Two).


I think the UpDown control only understands integer values ala
Get/SetDlgItemInt. The communication with its 'buddy' is done via WM_GETTEXT
and WM_SETTEXT, so presumably a subclass of the buddy window could
handle/intercept/forward these messages as needed to perform the back and
forth translations.
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #2
ReMEn wrote:
Didn't find much documentation on value formatting on a NumericUpDown
control. is it possible to separate numbers by a special character.

For example, If I wanted to display an option to change a person's height in
a NumericUpDown, I would not want them to see 62, I'd want them to see 6'2"
(6-Foot-Two).

Is this even possible?

Thankyou,


You can make a hiden link.

I mean, you have for example IDC_ED_FEET and IDC_SPIN_FEET linked now,
put one more editbox IDC_ED_FEETINT hidden (unvisible) in the window,
and make a link with IDC_SPIN_FEET. By pussing updown button, it will
actually change the content of IDC_ED_FEETINT, from 61 to 62, then
you capture the EN_CHANGE an update your IDC_ED_FEET to 6'2".
When user edited the string 6'2" to something else, you react to
EN_CHANGE and parse the new value and set the IDC_ED_FEETINT.
I don't know what to do if user edited to be "foobaa" instead of valid
height, then you may change the value to be 0.

Don't forget to make a semafor flag to distinguish user's input or
program code which changed the editbox, to avoid recursive EN_CHANGE events...
muchan
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
0
by: Koert | last post by:
Hi, In the NumericUpDown control I have to detect that Tab was pressed so I have overroden the PreProcessMessage function. In for example the DateTimePicker this works fine but not in the...
10
by: Bonj | last post by:
I'm using a number of NumericUpDown controls on my form, which controls printer settings such as number of pages. However I want to override one of the default behaviours of the control, namely...
0
by: Koert | last post by:
Hi In the NumericUpDown control I have to detect that Tab was pressed so I have inherited the NumericUpDown and overroden the PreProcessMessage function. In the DateTimePicker (for example) this...
3
by: abc my vclass | last post by:
My win-form have many numericupdown controls to applied. But numericupdown control don't like textbox, text box control can automatic selected text when got focus. Is there any method can let me...
4
by: illegal.prime | last post by:
Hey all, I have a NumericUpDown control on a Panel or potentially a Form that have AutoScroll enabled. When the NumericUpDown is active I would like the Form/Panel/whatever not to scroll when I...
5
by: Len Weltman | last post by:
I am trying to pass a NumericUpDown object into a class method using Visual Studio 2005, but the control type is not found in Intellisense and the type declaration is flagged as an error. Here...
2
by: Stephan Zaubzer | last post by:
Hi all, I encountered a problem with NumericUpDown yesterday and managed to reproduce the error with a very easy examle. I have a Windows Application with only one Form, which contains only one...
2
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello experts, I posted a disturbing question in here:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.