Hi.
I would like to implement a progress bar one pane of the statusbar. Current, the statusbar has two panes. Pane 1 (index 0) is the default separator where you see "Ready." The second pane is contains the progressbar. Here is the code.
-----
CRect progressRect;
m_wndStatusBar.GetItemRect(1, &progressRect);
m_ProgressBar.Create(WS_CHILD | WS_VISIBLE | SBPS_NOBORDERS | PBS_SMOOTH, progressRect, this, -1);
m_ProgressBar.SetRange(0, 100);
m_ProgressBar.SetPos(0);
-----
Here is the code that tests the progressbar.
-----
for (int i = 0; i < 100; ++i)
{
{
m_ProgressBar.SetPos(i);
::Sleep(25);
}
}
-----
For some reason, I do not see any sign of the progressbar working. I have an option in the menu to start the for loop. However, I do not see any sign of the progressbar, period. I am using SDI. The code above are all part of main.
Thanks,
Kuphryn
I would like to implement a progress bar one pane of the statusbar. Current, the statusbar has two panes. Pane 1 (index 0) is the default separator where you see "Ready." The second pane is contains the progressbar. Here is the code.
-----
CRect progressRect;
m_wndStatusBar.GetItemRect(1, &progressRect);
m_ProgressBar.Create(WS_CHILD | WS_VISIBLE | SBPS_NOBORDERS | PBS_SMOOTH, progressRect, this, -1);
m_ProgressBar.SetRange(0, 100);
m_ProgressBar.SetPos(0);
-----
Here is the code that tests the progressbar.
-----
for (int i = 0; i < 100; ++i)
{
{
m_ProgressBar.SetPos(i);
::Sleep(25);
}
}
-----
For some reason, I do not see any sign of the progressbar working. I have an option in the menu to start the for loop. However, I do not see any sign of the progressbar, period. I am using SDI. The code above are all part of main.
Thanks,
Kuphryn