Handle CSliderCtl messages placed on a CDialogBar

Posted by user173438 on Stack Overflow See other posts from Stack Overflow or by user173438
Published on 2010-05-13T13:55:19Z Indexed on 2010/05/13 21:24 UTC
Read the original article Hit count: 140

Filed under:

VS2008, 32 Bit Win XP

In a class derived from CFrameWnd, I have an object of CDialogBar that needs to have certain controls on it. Among these controls would be 2 sliders, whose event handling is to be done in CFrameWnd derived class. How shall I go about this?

class CFrameWndCustom : public CFrameWnd 
{ 
    CDialogBar m_wndDialogBar; // the CDialogBar object. 
} 

In CFrameWnd derived class's OnCreateClient, I have created the DialogBar using the above object like:

//Create the DialogBar 
if (!m_wndDialogBar.Create(this, 
                                        IDD_DIALOGBAR_CONTROL, 
                                        CBRS_BOTTOM, 
                                        IDD_DIALOGBAR_CONTROL)) 
{ 
        TRACE("Warning: Couldn't create DialogBar Control!\n"); 
        return FALSE; 
} 

Here, IDD_DIALOGBAR_CONTROL is a dialog resource with Style as Child. After this, I drag-dropped a CSliderCtrl on the IDD_DIALOGBAR_CONTROL in Resource View.

Now, how/where should I handle the CSliderCtrl's events? There would be 2 such slider controls.

I finally need the values of the sliders in CFrameWndCustom class.

best regards,

Divya

© Stack Overflow or respective owner

Related posts about mfc