Thread: Progressbar as Part of Statusbar :: MFC

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Progressbar as Part of Statusbar :: MFC

    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

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    >> for (int i = 0; i < 100; ++i)

    shouldnt it be i++?

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    ++i is preferred.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mfc
    By fkheng in forum Windows Programming
    Replies: 2
    Last Post: 07-23-2003, 02:12 AM
  2. MFC Controls and Thread Safety :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 11:36 AM
  3. MFC with .NET
    By dead_cell in forum C++ Programming
    Replies: 2
    Last Post: 08-20-2002, 12:02 AM
  4. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 06:58 PM
  5. MFC:: CString & Serialize ::C++
    By kuphryn in forum C++ Programming
    Replies: 0
    Last Post: 02-22-2002, 03:31 PM