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 Tech Support » How can I use CExtWFF in design mode in Visual Studio? Collapse All
Subject Author Date
Andreas Werner Oct 27, 2006 - 8:28 AM

I want to use a CExtWFF <CListCtrl> in design mode in Visual Studio. I have done the following:

In the graphical designer I have dropped a CListCtrl to the dialog I use. I have modified the CDialog class that was generated by Visual Studio in the following way:

In the header file I have declared a member of CExtWFF <CListCtrl>
#if !defined(AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_)
#define AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Dialog2.h : Header-Datei
//
class CDialog2 : public CExtResizableDialog
{
// Konstruktion
public:
    CDialog2(CWnd* pParent = NULL); // Standardkonstruktor
    ~CDialog2 ();

// Dialogfelddaten
    //{{AFX_DATA(CDialog2)
    enum { IDD = IDD_DIALOG2 };
    //}}AFX_DATA
    CExtPropertyGridCtrl m_PGC;
    CExtWFF <CListCtrl> m_LC; //
    
// Überschreibungen
    // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen
    //{{AFX_VIRTUAL(CDialog2)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung
    //}}AFX_VIRTUAL
    

// Implementierung
protected:

    // Generierte Nachrichtenzuordnungsfunktionen
    //{{AFX_MSG(CDialog2)
    virtual BOOL OnInitDialog();
    afx_msg void OnItemchangedCustumListCtrl(NMHDR* pNMHDR, LRESULT* pResult);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein.

#endif // AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_




In the implementation I have added the following code:

void CDialog2::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CDialog2)
    //}}AFX_DATA_MAP
    DDX_Control(pDX,IDC_CUSTOM_PROPERTY_GRID, m_PGC);
    DDX_Control(pDX,IDC_CUSTOM_LIST_CTRL, m_LC);
}


BEGIN_MESSAGE_MAP(CDialog2, CDialog)
    //{{AFX_MSG_MAP(CDialog2)
    ON_NOTIFY(LVN_ITEMCHANGED, IDC_COSTUM_LIST_CTRL, OnItemchangedCustumListCtrl)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()


BOOL CDialog2::OnInitDialog()
{
    CExtResizableDialog::OnInitDialog();
    
    AddAnchor(IDC_CUSTOM_LIST_CTRL, CPoint(0,0), CPoint(100,100));
    AddAnchor(IDC_CUSTOM_PROPERTY_GRID, CPoint(0,100), CPoint(100,100));

    return TRUE;
}

The list works well. I can use anchoring and message notification. The problem is. The list is not shown in the style of the Prof-UIS themes. For example if I use the Office 2007 themes the scrollbars of the list do not change their colour if the mouse is moved over the scrollbar, instead they remain grey like usual windows scroll bars.

What is missing in my code to make the list control look correctly?
Which style settings should be applied to the list?

With best regards Andreas

Technical Support Oct 28, 2006 - 11:44 AM

Thank you for the interesting question but it has little to do with to the CExtWFF template class.

The following article explains how to use the scroll bar windows with common controls.

This test project implements the approach described in the article (with regard to CExtScrollBar windows).

Unfortunately, in any case you will not able to see Prof-UIS-themed controls in design mode because this is not possible. Unlike ActiveX controls, the MFC based C++ classes do not support the design mode.