Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:05:02+00:00 2026-05-26T01:05:02+00:00

I am trying to use an edit control along with a spin control using

  • 0

I am trying to use an edit control along with a spin control using MFC visual studio .net 2003. I have carried out the basic settings for the spin control like setting the “AutoBuddy” property and “SetBuddyInteger” property to True so that the Spin control works in coordination with the edit control next to it. In my Spin control’s event handler, I am facing a problem when I am trying to call my Invalidate() function. The float value in my edit control does not update and stays zero. If I remove the Invalidate(), then the value increments but my paint function is not updated obviously. A code of the following is given below:

void CMyDlg::OnSpinA(NMHDR *pNMHDR, LRESULT *pResult)
{
    LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
    // TODO: Add your control notification handler code here
    UpdateData();
    m_A = m_ASpinCtrl.GetPos(); // m_A is my edit control float value variable
    Invalidate(); // Invalidate is to be called to update my paint function to redraw the drawing
    UpdateData(false);
    *pResult = 0;
}

I have carried out the tab order correctly as well for the two controls.

Any suggestions on where I am going wrong?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:05:03+00:00Added an answer on May 26, 2026 at 1:05 am

    m_A when getting the position back would do something weird and would not return you the correct value. Try using the pointer to get your position and value and then carry out the invalidate().

    {
            LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
            // TODO: Add your control notification handler code here
            UpdateData();
    
            CString tempStr;
            m_A += pNMUpDown->iDelta;
           tempStr.Format("%f",m_A);
            m_ACtrl.SetWindowText(tempStr); // Like a CEdit m_ACtrl to display your string
    
            Invalidate();
            UpdateData(false);
            *pResult = 0;
    }
    

    This should work perfectly well. Let me know if you still get any problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the Edit Control within an Dialog. When I use this
OKay I don't use actionscript and trying to help my friend edit a flash
I am trying to use an IsDirty flag to control CanExecute and Navigational controls
Im trying to use http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/ as inspiration, but I'm having some troubles with the
I have a C# .NET 2.0 WinForms app. My app has a control that
I am trying to use Blend 3.0 to edit a project that contains some
I have been trying to use localstorage to store Jquery-min but I am unable
im trying to use a file upload control from the obout control library, i
I'm trying to use declarative auth to control access to my site. But when
I'm trying to popup a user control and then fade it out over 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.