Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep a bitMap painted on a button?... 1

Status
Not open for further replies.

C2GUICOBOL

Programmer
Mar 15, 2005
9
0
0
US
Hello,

I am having difficulty getting a bitMap to remain displayed
on a tabControl. I have created a dialogBox with a memory
template by calling the win32 "DialogBoxIndirectParam", and
included a tabControl into the dialogBox with the function
"CreateWindowEx", and the preDefined system class
"SysTabControl32", then added a pushButton to the center of
the tabControl. Now, when I paint a bitMap on the
pushButton by calling the "StretchBlt" function, the bitMap
gets painted on the button for only one second, then it
will disappear from view.

if I remove the tabControl from the dialogBox, the bitMap
will remain painted on the pushButton --- So, I guess am
missing something here.

your help with this problem is appreciated. Thanks.

 
Look into "ownerdraw". This allows you to control the painting of the control. What's happening is that you paint the image on the button, but then Windows (who thinks he's in charge of painting buttons) will draw back over it with the system image.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi ChipH,

Thanks for the reply. Should I also use the tabControl
style TCS_OWNERDRAWFIXED, since I am painting a button
on the tabControl ??

Regards.

 
Possibly. I don't know.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top