Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to repaint a TComboBox drop-down list after it has dropped down?

51 views
Skip to first unread message

Richard Harriss

unread,
Nov 10, 2003, 12:31:38 PM11/10/03
to
Hi,

I am using a standard TCombobox on a form. I am owner-drawing the list, and
would like to have some flashing colors in the list. I have a timer-like
thread that calls a procedure that I will use to do the update, but what do
I use to update the list when it is already visible? Is this even possible?

I have tried posting paint messages to the handle of the drop-down list, but
so far nothing works.

Thanks,

Richard


Iain Macmillan

unread,
Nov 10, 2003, 12:54:48 PM11/10/03
to
In article <3faf...@newsgroups.borland.com>, "Richard Harriss"
<richard...@halcyonsoftware.com> wrote:


> Hi,
>
> I am using a standard TCombobox on a form. I am owner-drawing the list, and
> would like to have some flashing colors in the list.

Ugh! %-).

> I have a timer-like
> thread that calls a procedure that I will use to do the update, but what do
> I use to update the list when it is already visible? Is this even possible?
>
> I have tried posting paint messages to the handle of the drop-down list, but
> so far nothing works.

I think you may need to 'Invalidate' the component first, or Windows will
think that no painting is needed.

Does your painting procedure fire when another window/app has covered the
box and then revealed it again?

Kurt Barthelmess (TeamB)

unread,
Nov 10, 2003, 1:25:34 PM11/10/03
to
"Iain Macmillan" <he...@ariesps.co.uk> wrote:

>Ugh! %-).

<g> Hey, it could be worse.

>I think you may need to 'Invalidate' the component first, or Windows will
>think that no painting is needed.

The list isn't part of the component's window however, so that won't
be adequate. He needs to (at least) invalidate that ComboLBox class
window which is a child of the desktop.

Kurt

Kurt Barthelmess (TeamB)

unread,
Nov 10, 2003, 1:21:50 PM11/10/03
to
"Richard Harriss" <richard...@halcyonsoftware.com> wrote:

If you have managed to find the handle of the drop down list (not the
combo box itself - that's a different window) you should be able to
invalidate it. Use:

InvalidateRect(Handle, nil, False);

Good luck.

Kurt

Peter Below (TeamB)

unread,
Nov 10, 2003, 3:07:50 PM11/10/03
to
In article <3faf...@newsgroups.borland.com>, Richard Harriss wrote:
> I am using a standard TCombobox on a form. I am owner-drawing the list, and
> would like to have some flashing colors in the list. I have a timer-like
> thread that calls a procedure that I will use to do the update, but what do
> I use to update the list when it is already visible? Is this even possible?

Anything is possible if you throw enough money at it <G>.

>
> I have tried posting paint messages to the handle of the drop-down list, but
> so far nothing works.

InvalidateRect( dropdownlisthandle, areaofitemtorepaint );
UpdateWindow( dropdownlisthandle );


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be


0 new messages