Spin Control Notification
I have a spin control for which I need to execute a particular function AFTER the user has released the button (up or down) on the spin control... that is, I do not want to do this function for each iteration of the spin control... ONLY when the spin control has stopped incrementing. The only message handlers I see that are offered by the MFC ClassWizard are NM_OUTOFMEMORY and UDN_DELTAPOS. Neither of these seems to be what I need.
How can I know that the spin control has changed its buddy CEdit control AND that the spin control is not continuing to increment?
Re: Spin Control Notification
Sford or Ovidiucucu:
I'm trying to do the same thing in VC++6, but till now i can't , Ovidiucucu you said that after sending UDN_DELTAPOS a WM_VSCROLL or WM_VSCROLL is sent , so for spin control (not scroll bar) WM_VSCROLL and WM_VSCROLL are sent too? .Only to see if this is happening in my app ,i wrote:
Code:
void CADialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// the position was not changed, so...
AfxMessageBox( _T("Bau!!!") );
return;
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
i think that with this every time the i touch de spin, the message box should apperas, but it doesn't. The code compiles with no erros.
What is wrong ?
Re: Spin Control Notification
Quote:
Originally Posted by
Timbk
Sford or Ovidiucucu:
I'm trying to do the same thing in VC++6, but till now i can't , Ovidiucucu you said that after sending UDN_DELTAPOS a WM_VSCROLL or WM_VSCROLL is sent , so for spin control (not scroll bar) WM_VSCROLL and WM_VSCROLL are sent too? .Only to see if this is happening in my app ,i wrote:
Code:
void CADialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// the position was not changed, so...
AfxMessageBox( _T("Bau!!!") );
return;
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
i think that with this every time the i touch de spin, the message box should apperas, but it doesn't. The code compiles with no erros.
What is wrong ?
Did you create the corresponding message map entry for OnVScroll?
Re: Spin Control Notification
:) Nice, the message map entry was wrong , now works nicely. 1 day to solve this :( , anyway this is how it looks now
header file
Code:
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
Source file
Message map
And handler
Code:
void CCalibracionDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if(SB_ENDSCROLL == nSBCode)
{
if(pScrollBar->m_hWnd == m_Spin1m_hWnd)
{
// the position was not changed, so...
AfxMessageBox( _T("Termino el Spin1!!!") );
return;
}
if(pScrollBar->m_hWnd == m_Spin2.m_hWnd)
{
// the position was not changed, so...
AfxMessageBox( _T("Termino el Spin2!!!") );
return;
}
}
}
Thanks Arjay, where are you from?
Re: Spin Control Notification
Quote:
Originally Posted by
Timbk
Thanks Arjay, where are you from?
...from a galaxy far, far away.
Re: Spin Control Notification
Quote:
Originally Posted by
Arjay
...from a galaxy far, far away.
incredible, even that, your posts come so fast !!!
Re: Spin Control Notification
I live in Bellevue, WA - close to Seattle. When I moved there I traded in my light saber for a high speed internet connection.
Re: Spin Control Notification
Jejejej , i thought that, well thanks again, and May the Force be with you, oh no no i have to say May the speed be with you.