How to force ListBox to redraw specified item?

E

Evgeny Zoldin

Hi ALL,

I would like to force ListBox control to redraw list item specified by e.g.
index. How to do that?

Thanx

Evgeny

P.S. Problem arised from the following ListBox specific:

Lets item 1 is selected. Man clicks left mouse button on the item 2. The
following sequence takes place:

DrawItem for item 1 and state of item 1 is Selected
DrawItem for item 1 and state of item 1 is NOT Selected
DrawItem for item 2 and state of item 1 is Selected, NOT Focused
DrawItem for item 2 and state of item 1 is Selected and Focused
Handle for MouseDown event with mouse coordinates in the item 2 and

CType(sender, ListBox.SelectedItems(0) = index of the item 1

But I need to force redraw the item 1 after or in handling MouseDown. How to
do it?
 
T

Tim Wilson

What about something similar to this:
Me.ListBox1.Invalidate(Me.ListBox1.GetItemRectangle(0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top