RADなら貼りつければそれで終り。
自力ならクラス"msctls_progress32"で子ウインドウ作成。
ウインドウハンドルを取得してメッセージを送るだけ。
メッセージ |
wParam |
lparam |
意味 |
PBM_SETRANGE32 |
最小 |
最大 |
範囲を指定 |
PBM_SETSTEP |
増分 |
- |
PBM_STEPITの増分値 |
PBM_STEPIT |
- |
- |
PBM_SETSTEPの値だけ進める |
PBM_SETPOS |
位置 |
- |
現在位置を指定 |
PBM_GETPOS |
- |
- |
現在位置を取得 |
ウインドウにボタンとプログレスバーを貼り、ボタンpush,ウインドウCreateイベントを書く。
Sub MainWnd_CommandButton1_Click()
Dim i As Long
Dim hpg As HWND
hpg=GetDlgItem(hMainWnd,ProgressBar1)
for i=0 to 100
SendMessage(hpg,PBM_SETPOS,i,0)
Sleep(1)
next i
End Sub
Sub MainWnd_Create(ByRef CreateStruct As CREATESTRUCT)
Dim hpg As HWND
hpg=GetDlgItem(hMainWnd,ProgressBar1)
SendMessage(hpg,PBM_SETRANGE32,0,100)
SendMessage(hpg,PBM_SETPOS,10,0)
End Sub
最終更新:2010年10月22日 06:20