Click here to Skip to main content
15,922,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question ... Pin
HakunaMatada16-Mar-06 0:09
HakunaMatada16-Mar-06 0:09 
Questionadding controls in onpaint Pin
Tarek Jabri15-Mar-06 23:03
Tarek Jabri15-Mar-06 23:03 
AnswerRe: adding controls in onpaint Pin
Cedric Moonen15-Mar-06 23:09
Cedric Moonen15-Mar-06 23:09 
AnswerRe: adding controls in onpaint Pin
Hamid_RT15-Mar-06 23:19
Hamid_RT15-Mar-06 23:19 
GeneralRe: adding controls in onpaint Pin
Tarek Jabri15-Mar-06 23:38
Tarek Jabri15-Mar-06 23:38 
GeneralRe: adding controls in onpaint Pin
toxcct15-Mar-06 23:58
toxcct15-Mar-06 23:58 
GeneralRe: adding controls in onpaint Pin
Hamid_RT16-Mar-06 0:02
Hamid_RT16-Mar-06 0:02 
AnswerRe: adding controls in onpaint Pin
Maximilien16-Mar-06 3:01
Maximilien16-Mar-06 3:01 
I think you need to re-think your design; you simply cannot create controls in the OnPaint.

in your main view, you will draw an OBJECT.

that OBJECT will be a class ( CWnd derived ) that will take care of creating/owning its Button and drawing the shape.

for example, a rough implementation :

 /// in that class you will create a button, and use the OnPaint to draw the shape.
class CButtonShape : public CWnd
{
	DECLARE_DYNAMIC(CButtonShape)
	
	CBrush m_Brush;
	CButton m_Button;
public:
	CButtonShape();
	virtual ~CButtonShape();

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};


and use the view to create and display that class ( or many as you wish ).




Maximilien Lincourt
Your Head A Splode - Strong Bad
QuestionWhy font size is specified as 8, 10, 12, 14... Pin
Nishad S15-Mar-06 22:38
Nishad S15-Mar-06 22:38 
AnswerRe: Why font size is specified as 8, 10, 12, 14... Pin
Chris Losinger16-Mar-06 2:07
professionalChris Losinger16-Mar-06 2:07 
GeneralRe: Why font size is specified as 8, 10, 12, 14... Pin
Nishad S16-Mar-06 16:19
Nishad S16-Mar-06 16:19 
QuestionListView in vc++ 6.0 Pin
pankajgarg1215-Mar-06 22:10
pankajgarg1215-Mar-06 22:10 
AnswerRe: ListView in vc++ 6.0 Pin
toxcct15-Mar-06 22:23
toxcct15-Mar-06 22:23 
QuestionHow to test TCP/IP connection on the client-side? Pin
RoseAl15-Mar-06 21:57
RoseAl15-Mar-06 21:57 
AnswerRe: How to test TCP/IP connection on the client-side? Pin
Dathan Tseng15-Mar-06 21:59
Dathan Tseng15-Mar-06 21:59 
AnswerRe: How to test TCP/IP connection on the client-side? Pin
sunit515-Mar-06 22:07
sunit515-Mar-06 22:07 
QuestionPrinters !!! Pin
vikramlinux15-Mar-06 21:47
vikramlinux15-Mar-06 21:47 
Questioninsert char into buffer Pin
beardy janggut15-Mar-06 21:25
beardy janggut15-Mar-06 21:25 
AnswerRe: insert char into buffer Pin
kakan15-Mar-06 21:32
professionalkakan15-Mar-06 21:32 
AnswerRe: insert char into buffer Pin
sunit515-Mar-06 21:45
sunit515-Mar-06 21:45 
AnswerRe: insert char into buffer Pin
Nishad S15-Mar-06 22:47
Nishad S15-Mar-06 22:47 
QuestionTreeView in vc++ 6.0 Pin
pankajgarg1215-Mar-06 21:12
pankajgarg1215-Mar-06 21:12 
AnswerRe: TreeView in vc++ 6.0 Pin
Nibu babu thomas15-Mar-06 21:18
Nibu babu thomas15-Mar-06 21:18 
AnswerRe: TreeView in vc++ 6.0 Pin
toxcct15-Mar-06 21:34
toxcct15-Mar-06 21:34 
AnswerRe: TreeView in vc++ 6.0 Pin
Michael Dunn16-Mar-06 5:18
sitebuilderMichael Dunn16-Mar-06 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.