Microsoft
Software
Hardware
Network
Question : simple: place a bitmap in a Cdialog
I want a small bitmap 10x10 pixel on a CDialog "MyDlg".
1) use OnPaint()
When I use OnPaint do draw it with provided dc, the graphical updating of the cdialog doesn't work anymore.
example 1:
the dialog has a CTabControl. When I click on Tabs, the inner dialog is not painted.
example 2: the windows OS doesn't repaint "MyDlg", when I drag another window over it.
2) using a picture control:
added in resource editor, placed on dialog( type CStatic), in the properties, switched to "bitmap", insert the desired resource bitmap "IDB_MY_LITTLE_BITMAP". In the resources, the bitmap is displayed. This is great. But this bitmap has a transparent color. it needs to be drawed using ::TransparentBlt(..) The transparent mode seems not supported for picture controls. So this is not an option (?)
3) using OnWmEraseBkgnd()
doesn't redraw the dialog, no matter of returning TRUE or FALSE. This message handler seems not suitable because I want the system to draw nearly everything of the CDialog. The Only thing I want to draw with a CDC object is a small bitmap. Everything else should be done by the system.
Where to add the drawing for my transparent bitmap ?
Thanks.
Answer : simple: place a bitmap in a Cdialog
Create a custom icon (also was so in VS6) of the size you want.
Random Solutions
convert date from visual basic to C#
Create an excel sheet programmatically using VB.NET
Page setup is greyed out in SSRS
Handle to the Listview in Open/Save Dialog
How to increase HEAP Memory on Windows 2003?
How to trigger Form events?
ado.net reading first sheet of excel file.
Shell versus Double-Click
.NET Solution With multiple projects
Can I use a hard drive and a enclosure to backup a Win98 computer?