全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1577
推到 Plurk!
推到 Facebook!

請問~我的微調鈕為什麼只能跑一次?

缺席
lhu555
一般會員


發表:1
回覆:0
積分:0
註冊:2008-07-10

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-07-10 17:21:16 IP:60.250.xxx.xxx 訂閱
請問~就是我要做一個微調的功能~
可是我的按鈕只會run一次就沒了 = =不知道為什麼~
按鈕1→按一下static1加1
static1
按鈕2→按一下static減1
為什麼我按的只會跑一次...救救我>"<

那如果我要使用vc的spin物件來做微調~
用win32api的話他參數要怎麼設定?

[code cpp]
LRESULT CALLBACK MemoryM(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{

unsigned short code;
int taddr;
char i,c[10],buf[20];
taddr = 0x98765432;
for (i=0;i<8;i )
{
c[i] = taddr & 0xf;
taddr >>= 4;
}
switch (message)
{
case WM_INITDIALOG:
_itoa(c[7],buf,16);
SetDlgItemText(hDlg,ID_M8,buf);//顯示9
_itoa(c[6],buf,16);
SetDlgItemText(hDlg,ID_M7,buf);//顯示8
_itoa(c[5],buf,16);
SetDlgItemText(hDlg,ID_M6,buf);//顯示7
_itoa(c[4],buf,16);
SetDlgItemText(hDlg,ID_M5,buf);//顯示6
_itoa(c[3],buf,16);
SetDlgItemText(hDlg,ID_M4,buf);//顯示5
_itoa(c[2],buf,16);
SetDlgItemText(hDlg,ID_M3,buf);//顯示4
_itoa(c[1],buf,16);
SetDlgItemText(hDlg,ID_M2,buf);//顯示3
_itoa(c[0],buf,16);
SetDlgItemText(hDlg,ID_M1,buf);//顯示2
return(TRUE);

case WM_COMMAND:
switch (LOWORD(wParam))
{
case 24:
c[7] = (c[7] 1) % 16;
_itoa(c[7],buf,16);
SetDlgItemText(hDlg,ID_M8,buf);//按一下在ID_M8裡顯示9 1=a
return(TRUE);
case 25:
c[7] = (c[7] 15) % 16;
_itoa(c[7],buf,16);
SetDlgItemText(hDlg,ID_M8,buf);//減一。
return(TRUE);
/* case 22:
SetWindowText(hControl7,"0");
return(TRUE);
case 23:
SetWindowText(hControl7,"0");
return(TRUE);
case 20:
SetWindowText(hControl6,"0");
return(TRUE);
case 21:
SetWindowText(hControl6,"0");
return(TRUE);
case 18:
SetWindowText(hControl5,"0");
return(TRUE);
case 19:
SetWindowText(hControl5,"0");
return(TRUE);
case 16:
SetWindowText(hControl4,"0");
return(TRUE);
case 17:
SetWindowText(hControl4,"0");
return(TRUE);
case 14:
SetWindowText(hControl3,"0");
return(TRUE);
case 15:
SetWindowText(hControl3,"0");
return(TRUE);
case 12:
SetWindowText(hControl2,"0");
return(TRUE);
case 13:
SetWindowText(hControl2,"0");
return(TRUE);
case 10:
SetWindowText(hControl1,"0");
return(TRUE);
case 11:
SetWindowText(hControl1,"0");
return(TRUE);*/
case IDOK:
addr = (c[7]<<28) | (c[6]<<24) | (c[5]<<20) | (c[4]<<16) |
(c[3]<<12) | (c[2]<<8) | (c[1]<<4) | c[0];
EndDialog(hDlg,FALSE);
return(TRUE);
case IDCANCEL:
EndDialog(hDlg,FALSE);
return(TRUE);
}
break;
}
return(FALSE);
}

[/code]
編輯記錄
lhu555 重新編輯於 2008-07-11 15:35:02, 註解 無‧
系統時間:2024-04-26 23:17:23
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!