我的Spin控件没有设置伙伴,直接SetPos(),接着GetPos(),然后把发现得到的返回值不是我SetPos给的那个值! 请问这是为什么?

解决方案 »

  1.   

    m_pin.SetPos(30);int nPos = m_pin.GetPos();
    CString str;
    str.Format(_T("%d"), LOWORD(nPos));int GetPos( ) const;
    int GetPos32(
       LPBOOL lpbError = NULL 
    ) const;The first version returns the 16-bit current position in the low-order word. The high-order word is nonzero if an error occurred. The second version returns the 32-bit position. 
      

  2.   

    BOOL SetAccel(int nAccel, UDACCEL* pAccel);
    UINT GetAccel(int nAccel, UDACCEL* pAccel) const;
    int SetBase(int nBase);
    UINT GetBase() const;
    CWnd* SetBuddy(CWnd* pWndBuddy);
    CWnd* GetBuddy() const;
    int SetPos(int nPos);
    int GetPos() const;
    void SetRange(int nLower, int nUpper);
    void SetRange32(int nLower, int nUpper);
    DWORD GetRange() const;
    void GetRange(int &lower, int& upper) const;
    void GetRange32(int &lower, int& upper) const;
    我看CSpinButtonCtrl那里面没有GetPos32()这个函数啊?