Solved

Displaying a Button

Posted on 1998-12-09
4
218 Views
Last Modified: 2010-04-02
I created a button class in classwizard that inherits from CButton. I then displayed it by calling create. However, when I override OnPaint(), it no longer displays the
button. Calling CButton::OnPaint() does not seem to help. What must I do? Thanks.
0
Comment
Question by:stin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1179752
What is the code you have in OnPaint?  Do you call BeginPaint and EndPaint?
0
 
LVL 1

Accepted Solution

by:
The_Brain earned 50 total points
ID: 1179753
That is because you inherited it... Or you overrode the very funtion that actually does the work onpaint.  (you did use classwizard. didn't you?  
You must actually declare the thing you want displayed once you override this function.  
(i think, tell me if this is the problem, I don't have time to check. I gonna sleep now.)
0
 

Author Comment

by:stin
ID: 1179754
I did override OnPaint() using classwizard.  I did not call BeginPaint() or EndPaint(), I simply wanted to change the font.  What I'm trying to do is read a list of strings from a DB and then create an array of buttons, one for each string.  I created an array of buttons, and called Create() for each of the buttons.  This seemed to work fine.  Then, when I overrode OnPaint() using classwizard my buttons disappeared.  How can I change the font while also keeping the default OnPaint() functionality?  Thanks
0
 
LVL 22

Expert Comment

by:nietod
ID: 1179755
You will have to do the work of painting the button youself.  That means using BeginPaint and EndPaint etc.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create string splitting user defined function in C++ 23 337
C++ get user from AD  (VS6) 7 95
How to gracefully close the c++ 11 thread? 3 123
gdb doesn't stop on breakpoint 2 114
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question