CSpinButtonCtrl控制項的使用方法

2021-05-23 22:55:38 字數 656 閱讀 1955

第一步

cspinbuttonctrl 需要乙個夥伴視窗才可以完成功能。

夥伴視窗一般為編輯控制項

在dialog上加 spin控制項, edit控制項。

然後**為:

m_spin1.setbuddy(getdlgitem(idc_show_edit));  //設定夥伴視窗

m_spin1.setrange(-100, 100);   //設定min~max

//m_spin1.setpos(2);   //設定起始位置,可以不用

m_nshownumber = 9;

updatedata(false);

其中:m_spin1繫結到spin控制項。 為控制項型別

m_nshownumber 繫結到edit控制項。 為uint型別

第二步:

訊息迴圈:

對spin 控制項進行 classwizard ,選擇udn_deltapos 訊息

然後編寫**:

然後 編譯執行就可以用了~~

CSpinButtonCtrl的弱智問題

今天做的乙個復合控制項中用到了cspinbuttonctrl。直接就寫了下面的 cedit pedit new cedit crect rc pedit createex ws ex staticedge,edit null,ws child ws tabstop,rc,this,id edit p...

CSpinButtonCtrl的弱智問題

今天做的乙個復合控制項中用到了cspinbuttonctrl。直接就寫了下面的 cedit pedit new cedit crect rc pedit createex ws ex staticedge,edit null,ws child ws tabstop,rc,this,id edit p...

CSpinButtonCtrl的弱智問題

今天做的乙個復合控制項中用到了cspinbuttonctrl。直接就寫了下面的 cedit pedit new cedit crectrc pedit createex ws ex staticedge,edit null,ws child ws tabstop,rc,this,id edit pe...