Re: Numeric spin control,

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Yes, and I didn't want to get into the weird things I have to do to make THAT work right!
Consider that if I intercept the message, I can't change the text and call the superclass
because the brain-dead implementation of MFC screws it up, by ignoring my explicit
parameters and using the original ones. And if I issue my own WM_SETTEXT, then my handler
gets to intercept it again...Not A Pretty Sight.
joe

On Tue, 11 Jul 2006 21:26:31 -0500, "Jeff Partch" <jeffp@xxxxxxxx> wrote:

Well it does send a message: WM_SETTEXT.

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:28l8b2l8r4a855778tan28mh1d046gmvbh@xxxxxxxxxx
This is a real problem, caused by a faiure in the design of the buddy
control system. In
a sane design, it would simply send a message to the buddy control that
indicated what
value should be set, and the default handler would convert this to an
integer or to
whatever representation it felt like. Alas, the design is not nearly so
sane. Your
proposed solution is certainly one that would seem effective. Use the
WM_HSCROLL or
WM_VSCROLL (depending on the orientation of your spin control) to provide
this service.
joe

On Tue, 11 Jul 2006 13:55:40 -0700, "vsgdp" <hello@xxxxxxxx> wrote:

Hi, I want to make each tick of the spin control increment the value in
the
buddy edit control by a fraction:
For example,

1 tick --> 0.1
2 tick --> 0.2
3 tick --> 0.3
4 tick --> 0.4
etc

I don't think there is an automatic way to do this, as it seems to
increment
only by integer values.

Would the solution be to disable "Set buddy integer", check for a spin
arrow
press, convert spin integer value to the numeric value I want, then update
edit control?

What messages do I capture when one of the arrows of a spin control is
pressed?

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Numeric spin control,
    ... Since I rarely work just one level down in ... control system. ... tick --> 0.1 ... What messages do I capture when one of the arrows of a spin control is ...
    (microsoft.public.vc.mfc)
  • Re: Numeric spin control,
    ... Consider that if I intercept the message, I can't change the text and call ... control system. ... tick --> 0.1 ... What messages do I capture when one of the arrows of a spin control is ...
    (microsoft.public.vc.mfc)
  • Re: Numeric spin control,
    ... control system. ... WM_VSCROLL (depending on the orientation of your spin control) to provide ... buddy edit control by a fraction: ... tick --> 0.1 ...
    (microsoft.public.vc.mfc)
  • Re: Compare two form fields, prevent duplicate combination
    ... of that and intercept the ACCESS message. ... in a query nor a control on a form nor a control on a report). ... highlight both fields by holding down control and ... >> compound key. ...
    (microsoft.public.access.forms)
  • Re: CSpinCtrl problem
    ... exactly *one* edit control. ... Instead, select the auto-buddy for the spin control, and do a ... What I'm trying to do is set an edit control with associated spin ... If you're writing more than one GetDlgItem per year, ...
    (microsoft.public.vc.mfc)