Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / MFC

CButton with icon

Rate me:
Please Sign up or sign in to vote.
4.52/5 (24 votes)
12 Aug 2002CPOL 252.8K   7.3K   59  
A small class to create a button with an icon on it
#if !defined(AFX_BUTTONDEMODLG_H__56308816_7C4B_11D6_A7AF_0000CB599868__INCLUDED_)
#define AFX_BUTTONDEMODLG_H__56308816_7C4B_11D6_A7AF_0000CB599868__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "iconbutton.h"



class CButtonDemoDlg : public CDialog
{
// Konstruktion
public:
	CButtonDemoDlg(CWnd* pParent = NULL);   // Standardkonstruktor

// Dialogfelddaten
	//{{AFX_DATA(CButtonDemoDlg)
	enum { IDD = IDD_DIALOG1 };
	CSpinButtonCtrl	m_iconsize;
	CIconButton	m_exit;
	CIconButton	m_demobutton;
	BOOL	m_bUnderline;
	BOOL	m_bItalic;
	BOOL	m_bStrikeOut;
	UINT	m_nR;
	UINT	m_nG;
	UINT	m_nB;
	int		m_nIconSize;
	int		m_nFontHeight;
	int		m_nFontWidth;
	//}}AFX_DATA


// �berschreibungen
	// Vom Klassen-Assistenten generierte virtuelle Funktions�berschreibungen
	//{{AFX_VIRTUAL(CButtonDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV-Unterst�tzung
	//}}AFX_VIRTUAL

// Implementierung
protected:

	void NewButtonStatus ( void );


	CString m_sFontName;
	bool	m_bDisabled;
	bool	m_bWithIcon;
	bool	m_bIconRight;


	// Generierte Nachrichtenzuordnungsfunktionen
	//{{AFX_MSG(CButtonDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnChangeStatus();
	afx_msg void OnRadio3();
	afx_msg void OnRadio4();
	afx_msg void OnRadio5();
	afx_msg void OnRadio6();
	afx_msg void OnRadio7();
	afx_msg void OnRadio8();
	afx_msg void OnRadio9();
	afx_msg void OnRadio1();
	afx_msg void OnRadio2();
	afx_msg void OnChangeColor();
	afx_msg void OnRadio10();
	afx_msg void OnRadio11();
	virtual void OnOK();
	afx_msg void OnChangeEdit();
	afx_msg void OnKillfocusEdit();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // AFX_BUTTONDEMODLG_H__56308816_7C4B_11D6_A7AF_0000CB599868__INCLUDED_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer www.rowa.de
Germany Germany
Working as software engineer since 2001. I started with c, c++ came up to c# and wpf today.

Comments and Discussions