Bitmap in Header sources?
Jesper Spring -- jesper_spring@Merck.Com
Thursday, August 01, 1996
Environment: NT 3.51/VC++ 4.0
Hi there
Can anyone point me to some sources of information on how to
draw a bitmap in a Header control. I anyone has got any sample
code that would be appreciated.
Thanks in advance
Jesper Honig Spring
Merck & Co., Inc., Denmark (MSD)
*** Standard Disclaimer ***
Jeff Evans -- Jeff.Evans@huey.cadvision.com
Monday, August 05, 1996
[Mini-digest: 2 responses]
> Can anyone point me to some sources of information on how to
> draw a bitmap in a Header control. I anyone has got any sample
> code that would be appreciated.
I've been able to do this successfully without MFC, so I'm not
entirely sure if you can do this with MFC, but it might give you the
right idea anyway..
There are two different methods that you can use to create a header
control with a bitmap inside it... When you create each column in the
header, you might be able to specify a handle to a BITMAP instead of
text (I say might because I'm not sure if it can be done with MFC)
The other way is to create an ownerdrawn column, and then manually
draw the column header each time the header control needs to be repainted
(the control calls it's parent's window procedure).
The advantage to using an ownerdrawn panel is that you get full
control over size and position of the bitmap.
You can find a whole pile of information on header controls in the
Win32 SDK (part of the book's online on the Visual C cd-rom), if you
search for common controls or header controls.
Jeff.
-----From: "Gary Capps"
Try this...
m_myBitmap.LoadBitmap( IDB_MYBITMAPID );
HD_ITEM hItem;
memset( &hItem, 0, sizeof( HD_ITEM ));
hItem.mask = HDI_FORMAT|HDI_BITMAP|HDI_WIDTH;
hItem.hbm = (HBITMAP)m_myBitmap;
hItem.cxy = nMyBitmapWidth;
hItem.fmt = HDF_BITMAP;
myHdrCtrl.InsertItem( nMyColumnIndex, &hItem );
---
gc
Norman, Oklahoma
----------
> From: Jesper Spring
> To: mfc-l
> Subject: Bitmap in Header sources?
> Date: Thursday, August 01, 1996 8:00 am
>
>
> Environment: NT 3.51/VC++ 4.0
>
> Hi there
>
> Can anyone point me to some sources of information on how to
> draw a bitmap in a Header control. I anyone has got any sample
> code that would be appreciated.
>
> Thanks in advance
>
> Jesper Honig Spring
> Merck & Co., Inc., Denmark (MSD)
> *** Standard Disclaimer ***
| Вернуться в корень Архива
|