Re: yet another owner-drawn CListBox question (problems with custom background patterns)
From: AliR (AliR_at_newsgroup.nospam)
Date: 01/19/05
- Next message: Dan Bloomquist: "Re: 64 bit version of CDWordArray?"
- Previous message: Frank Hickman [MVP]: "Re: GetUserNameEx"
- In reply to: me: "yet another owner-drawn CListBox question (problems with custom background patterns)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 18:56:23 GMT
I am just going to point out that I had to do this same thing that you are
doing, and ended up having to right a listbox control from scratch.
The reason is, the way the listbox handles scrolling. If you scroll up then
what it will do is bitblt everything from the first item to the one before
the last one, one line down. And vis versa. So if you repeatedly scroll
down then the background of all the items will become the same. (You can get
around this problem by invalidating the entire listbox everytime there is a
scroll message but it will flicker to death)
Let me know if you want my code that puts a bitmap as the listbox
background.
AliR.
"me" <me@here.com> wrote in message
news:cskm5g$l8u$1@sparta.btinternet.com...
> Does anyone have any experience of trying to render a custom background
> under the contents of an owner-drawn CListBox? I'm experimenting with a
> gradient fill but it could just as easily be a bitmap and what i've
noticed
> is that when the list-box is empty it seems like some kind of internal
> list-box code is executed to erase the list-box scroll area rather than
> going through OnEraseBkgnd (which is where i'm drawing the gradient).
>
> The result is that everything looks fine providing there are some items in
> the list but the instant that the last item is deleted the whole scroll
area
> flashes to white and stays there until some more items are added to the
list
> (whereupon the gradient reappears).
>
> Are there some other messages or callbacks I need to look at?
>
> Regards,
>
> Karl.
>
>
- Next message: Dan Bloomquist: "Re: 64 bit version of CDWordArray?"
- Previous message: Frank Hickman [MVP]: "Re: GetUserNameEx"
- In reply to: me: "yet another owner-drawn CListBox question (problems with custom background patterns)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|