Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to change button caption Collapse All
Subject Author Date
lester oidka Jul 4, 2006 - 2:02 AM

How could I change caption of buttons on CExtResizablePropertySheet? The constants I’ve found for the non-profuis prop.sheet () - PSBTN_BACK, PSWIZB_NEXT, PSWIZB_FINISH, PSWIZB_DISABLEDFINISH - are not ok

I wrote code like this:

void CMyWizard::SetButtonsCaption ()
{
    for (int i = 0; i < 10000; i++)
    {
        CString str;
        str.Format(_T("%d"), i);
        /// get button and set it’s caption
        CWnd * btn = this->GetDlgItem(i);
        if (btn != NULL) btn->SetWindowText(str);
    }
}

It goes throught all window child components and assigns them numbers. I have 4 buttons on my wizard but only 2 of them are really assigned even if all of them are it’s child windows.

I’ ve tried to run this code before every shown page but I wasn’t successfull...

So the question is - how to change button captions on CExtResizablePropertySheet.

Thank you and sory for complicated problem explanation :]

Technical Support Jul 4, 2006 - 11:04 AM

The following lines are present in the standard MFC’s AfxRes.h file:

// Property Sheet control id’s (determined with Spy++)
#define ID_APPLY_NOW                    0x3021
#define ID_WIZBACK                      0x3023
#define ID_WIZNEXT                      0x3024
#define ID_WIZFINISH                    0x3025
#define AFX_IDC_TAB_CONTROL             0x3020
These constants are available "as is" in any MFC based application. So you can use them in any property sheet control. To change the Back text to 123, do the following:
pPropertySheetWindow->GetDlgItem( ID_WIZBACK ) -> SetWindowText( _T("123") );