Need help with GetNextDlgTabItem()

Need help with GetNextDlgTabItem()

Post by T. Daniel Liebst » Tue, 11 Mar 1997 04:00:00



I have a dialog box with twelve radio buttons that are grouped in
pairs.  The radio buttons are the first 12 tab stops in the dialog.
The OK and CANCEL buttons are the 13th and 14th tab stops, and the
static group box that surrounds the radio buttons is the 15th stop.

I have set the first radio button to have the WS_GROUP style and also
the 3rd radio button, the 5th, etc. so that the buttons behave in
pairs.  I tried to set the font of the radio buttons with the
following code (as well as variations).  It only sets the first radio
button and then the OK and CANCEL buttons to have the "Symbol" font.  

I created a member variable for the first radio button so that I could
easily get a pointer to it.  I then wanted to step through the next
bunch of controls to set them.  I suppose that I could use the brute
force approach and make member variables for all of the radio button
controls, but that seems to lack elegance.  Any suggestions?  Here is
the code.

BOOL CComponentsDlg::OnInitDialog()
{
        CDialog::OnInitDialog();
        CDC* pDC = GetDC();
        m_Font.CreateFont( blah blah blah ); // all of the parameters
                                        // in my real code are set
                                        // correctly for a 12 point

                                        // "Symbol" font.

        // note that m_font is a class member of type CFont that lives

        // for the entire life of the dialog, as it should.    

        // Set the font of all the radio button labels to "symbol"

        CWnd* pStartPoint = &m_ctrlradio1;
        for (int i = 0; i < 12; i++)
        {
                pStartPoint->SetFont(&m_Font);
                pStartPoint = GetNextDlgTabItem(pStartPoint);
        }

Quote:}

 
 
 

1. Can someone help with GetNextDlgTabItem??

I have a dialog box with twelve radio buttons that are grouped in
pairs.  The radio buttons are the first 12 tab stops in the dialog.
The OK and CANCEL buttons are the 13th and 14th tab stops, and the
static group box that surrounds the radio buttons is the 15th stop.

I have set the first radio button to have the WS_GROUP style and also
the 3rd radio button, the 5th, etc. so that the buttons behave in
pairs.  I am trying to set the font of the radio buttons with the
following code.  What happens is that only the font of the first radio
button and then the OK and CANCEL buttons get set to the new font.  

I created a member variable for the first radio button (m_ctrlradio1)
so that I could easily get a pointer to it. Any suggestions?  Here is
the code:
-------------------------------------------------
BOOL CComponentsDlg::OnInitDialog()
{
        CDialog::OnInitDialog();
        CDC* pDC = GetDC();
        m_Font.CreateFont( blah blah blah ); // all of the parameters
                                        // in my real code are set
                                        // correctly for a 12 point

                                        // "Symbol" font.

        // note that m_font is a class member of type CFont that lives

        // for the entire life of the dialog    
        // Set the font of all the radio button labels to "symbol"

        CWnd* pWnd &m_ctrlradio1;
        for (int i = 0; i < 12; i++)
        {
                pWnd->SetFont(&m_Font);
                pWnd = GetNextDlgTabItem(pWnd);
        }
----------------------------
I managed to set the font of the first two radio buttons by using the
GetNextDlgGroupItem, but nothing I do seems to want to get past the
first pair of radio buttons.

Dan Liebster

2. Windows Media Player Buffering

3. I need help/I need help/I need help

4. Desktop to Restart loop.

5. Need Help with Apache1.2.30 Newbie needs help with Apache1.2.30 Win32.txt (1/1)

6. Font Type

7. Nt4 DNS need HELP!!! Nt4 DNS need HELP!!!

8. Cd autorun disappeared

9. HELP!HELP!HELP!HELP!HELP!HELP!HELP!HELP!HELP!HELP!HELP!HELP!

10. HELP * HELP * HELP: I Need new drivers for MPEG-MASTER

11. AVI codec needed..Need help

12. NEED SCHOOL INFO- NEED YOUR HELP

13. !!* NEED HELP MAKING NEW GAME !! ARTISTS, PROGRAMMERS NEEDED!!*