我想在和spin控件相关的edit里设置初始值为0.0000,但是关联后的edit用setwindowstext("0.0000")没有效,每次都是自动设置为0;我的步长是0.0001的;相关代码如下:
其中m_editstop/IDC_EDIT_STOPLOSS,m_spinstop/IDC_SPIN_STOPLOSSBOOL CNewOrder::OnInitDialog() 
{
CDialog::OnInitDialog();
m_spinstop.SetBuddy(&m_edtstop);
m_spinstop.SetRange(0,10000);
m_spinstop.SetPos(0);
return TRUE;  // return TRUE unless you set the focus to a control
              // EXCEPTION: OCX Property Pages should return FALSE
}void CNewOrder::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
// TODO: Add your message handler code here and/or call default
if(SB_ENDSCROLL==nSBCode)
return;
if(pScrollBar->GetDlgCtrlID()==IDC_SPIN_STOPLOSS)
{
CSpinButtonCtrl* pSpin=(CSpinButtonCtrl*)pScrollBar;
CString str;
str.Format("%3.4f",(double)pSpin->GetPos()/10000);
pSpin->GetBuddy()->SetWindowText(str);
}
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}