a Dialog Bar Question !
-
hi all now i am doing a SDI project, all of the views are CFormview Derived , and switching the formviews according to the menu commands. i want to implement a Dialogbar to my container, in such a way that i can show the status messages on that. i created the dialogbar from a dialog template and attached with the dialogbar object. i need a static control in the dialog bar inorder to show the status in each forms. how can i set the static text in dialogbar ??? like static_Control_variable_in_dialogbar.SetWindowText("test "); Any idea..?? programming in VB is like riding a kiddy bike, while programming in C++ is like driving a Formula 1 racing car
-
hi all now i am doing a SDI project, all of the views are CFormview Derived , and switching the formviews according to the menu commands. i want to implement a Dialogbar to my container, in such a way that i can show the status messages on that. i created the dialogbar from a dialog template and attached with the dialogbar object. i need a static control in the dialog bar inorder to show the status in each forms. how can i set the static text in dialogbar ??? like static_Control_variable_in_dialogbar.SetWindowText("test "); Any idea..?? programming in VB is like riding a kiddy bike, while programming in C++ is like driving a Formula 1 racing car
Since the dialogbar object is a member of frame class. You need to get the dialog bar object through AfxGetMainWnd. Check this
void CTestView::OnBnClickedButton1() { CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd(); if (pFrame) { pFrame->m_wndDialogBar.SetDlgItemText(IDC_MYSTATIC, "Hello"); } }
This is a message handler of a form view class The m_wndDialogBar is a public member of CMainFrame class IDC_MYSTATIC is the id of the static control in the dialog bar. You must change the id of a static control from IDC_STATIC to another.