From: mfc on
Hi,

is it possible to split the spin control from vs2010; so that one
arrow is left from the editbox and the other one is right from the
editbox?

look: << [edit-control] >>

Or is the only solution to use two buttons ("<<" and ">>") to control
the edit control?


best regards
Hans
From: Joseph M. Newcomer on
Since the spin control is a single button, I am not aware of any way to "split" a control.

I use owner-draw buttons on each side to achieve this.
joe

On Fri, 25 Jun 2010 05:47:16 -0700 (PDT), mfc <mfcprog(a)googlemail.com> wrote:

>Hi,
>
>is it possible to split the spin control from vs2010; so that one
>arrow is left from the editbox and the other one is right from the
>editbox?
>
>look: << [edit-control] >>
>
>Or is the only solution to use two buttons ("<<" and ">>") to control
>the edit control?
>
>
>best regards
>Hans
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: mfc on
it is working (using two cbuttons) but unfortunately the update of the
edit control (id = m_EdtRefresh) is very slowly.


//my-button-handle OnBtnClick()

UINT value = m_EdtRefresh.GetEdtBoxText();
if(value >= MAX_EDT_REFRESH)
return;
value++;
m_EdtRefresh.SetEdtBoxText(value);
m_EdtRefresh.Invalidate();

When I try to click on the button very fast, every second click is not
recognized...


Moreover is there an additional method which is called if the button
is pressed for at least three seconds, to increase the value faster?

best regards
Hans
From: mfc on
I found the solution: installed a new subclass for the specific
buttons and add this message handler.

void CSpinCtrlButton::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default

this->SendMessage(UWM_LBTN_DOWN, this, 0);

CImageTextButton::OnLButtonDown(nFlags, point);
}

Is it a good choice to use SendMessage() in this function to call the
dialog-class where all the items (edit control field) are available
which have to be updated.