Q

How can I edit a listview control's background and highlight the control after the user clicks?

A. I'm using a listview control in "large icon" mode as part of a custom control, but cannot figure out how to set the background color in the image area. The text background is settable, but the image background area seems to be fixed at 212,208,200. What am I missing?

B. How can I programmatically highlight a listview control as though a user clicked on an item in the collection?

A. Try setting the backcolor in a manner similar to this:

 Dim C As New System.Drawing.Color() ListView1.BackColor = C.Aqua

In .NET, the backcolor property is an object, not merely a value.

B. Try selecting the Listview control first like this:

 ListView1.Select() ListView1.Items(1).Selected = True

After selecting the listview, then set the Selected property of the proper item to True.

This was last published in September 2002

Dig Deeper on Service-oriented architecture (SOA) Design

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close