Re: FlexGrid and icons



Simon Woods <simonjwoods@xxxxxxxxxxx>'s wild thoughts were
released on Fri, 21 Dec 2007 16:15:20 +0000 bearing the
following fruit:

Jan Hyde (VB MVP) wrote:
Simon Woods <simonjwoods@xxxxxxxxxxx>'s wild thoughts were
released on Fri, 21 Dec 2007 14:13:41 +0000 bearing the
following fruit:

Hi

I'm populating a flexgrid and I want to put an icon into one of the
cells. I'm

1) loading a 16x16 icon from the Resource file into a memory variable
2) setting icon to a the cellpicture property

I have tried it with a 14x16 bitmap, it is absolutely fine. The problem
with the bitmap is the background is not transparent.

When I view this, the icon is too big (I mean massively too big, not
just 2 icons too big). When I view the icon in the resource file viewer,
it is also the right size.

So what do I need to do to get the icon to display as 16x16?

Are you sure it doesn't have multiple icon sizes in the one
.ico file?

Yep.

Try adding an imagelist and setting it to 16x16, add your
icon to it and retrieve it from there for display in the
grid. See if it displays the correct size or not.

OK. Thx Jan. I found an old thread that suggested this seems to be known
behaviour of the FlexGrid ... and that bitmaps were the way to go. Have
you managed to load a 16x16 icon into a flexgrid's .CellPicture? If so,
have you any sample code I could look at?

Its a long time since I used the MSFlexgrid but I recall I
used bitmaps myself but that was because I needed pictures
with odd dimensions.


--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
.