不要用默认的ID,你自己加一个ID,再改变文字试试

解决方案 »

  1.   

    CString m_Font1;
    int m_minu=2;
    m_Font1=_T("时间");
    m_Font1.Format("%s:%02d",m_Font1,m_Minu);
    SetDlgItemText(IDC_PLAYTIME,m_Font1);你试一试..
      

  2.   

    你等一下..喔刚才给你回复错了..那是基于对话框的..sorry.
      

  3.   

    先说一下,应该是这样的吧:)m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_CAPS),"try");另外,这种情况的出现往往和你的Pane的ID有关,我也遇到类似问题,原因就是ID与一些AFX的一些预定义有重复。你把id改了试试。
      

  4.   

    改动MainFrm.cpp中的static UINT indicators[] =
    { ID_SEPARATOR,      // status line indicator ID_CURRENTUSR,//你自己的定义的ID. ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL,};在OnCreat()中:m_wndStatusBar.SetPaneInfo(m_wndStatusBar.CommandToIndex(ID_CURRENTUSR),ID_CURRENTUSR,SBPS_NORMAL,100);m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_CURRENTUSR),YourText); 
      

  5.   

    Agree with despird.
    你有技术内幕这本书么?在321页有详细的介绍.
    static UINT indicators[] =
    {
    ID_SEPARATOR,      // status line indicator消息行        Value=0;
    // ID_CURRENTUSR,//你自己的定义的ID.      //value=1..看你申请的多少
    ID_INDICATOR_CAPS,    //   //value=1,类推
    ID_INDICATOR_NUM,     //   //value=2,
    ID_INDICATOR_SCRL,    //   //value=3(即索引值)
    };
    上面是状态栏的构造
    (1)如果要设置消息行:
    你必须先获得应用程序的对象部分.然后回到主框架窗口.
      CMainFrame* pFrame=(CMainFrame*)AfxGetApp()->m_PMainWnd;
      CStatusBar* pStatus=&pFrame->m_wndStatusBar;
      pStatus->SetPaneText(0,"message");
    (2).状态栏的控制
    要指定自己的ID就必须如下调用
    m_wndStatusBar.Create(this);
    改成m_wndStatusBar.Create(this,WS_CHILD|WS_VISIBLE_CBRS_BOTTOM,ID_MY_STATUS_BAR);//在资源文件中也应该定义
    (3)..一些参考代码
    在OnCreate函数中(MainFrm.cpp)
    替换你的东西:
    static UINT indicators[]=
    {
      ID_SEPARATOR,//first message line pane
      ID_SEPARATOR1,//second message line pane
      ......
    }
    ...................
    在MainFram.cpp中找到
    void CMainFrame::OnViewStatusBar()
    {
    m_wndStatusBar.ShowWindow((m_wndStatusBar.GetStyle()&WS_VISIBLE)==0);  //add
    RecalcLayout();//add
    }
    oidCMainFrame::OnUpdateViewStatusBar(CCmdUI* pCmdUI)
    {
    pCmdUI->SetCheckmwndStatusBarGetStyle()&WSVISIBLE0);
    }写控件:
    CString str;
    CMainFrame* pFrame=(CMainFrame*) AfxGetApp()->m_pMainWnd;
    CStatusBar* pStatus=&pFrame->m_wndStatusBar;
    if(pStatus){
    str.Format("x=%d",point.x);
    pStatus->SetPaneText(0,str);
    str.Format("y=%d",point.y);
    pStatus->SetPaneText(1,str);
    }
      

  6.   

    可以的呀,SetPaneText(0,"hello"),写最左边的。