Click here to Skip to main content
16,013,642 members
Home / Discussions / C#
   

C#

 
GeneralRe: Simulating mouse Pin
Bill Dean4-May-04 15:57
Bill Dean4-May-04 15:57 
GeneralRe: Simulating mouse Pin
Heath Stewart4-May-04 17:29
protectorHeath Stewart4-May-04 17:29 
GeneralRe: Simulating mouse Pin
Heath Stewart4-May-04 17:46
protectorHeath Stewart4-May-04 17:46 
Generalalternative to listbox Pin
mookeroo4-May-04 14:00
mookeroo4-May-04 14:00 
GeneralRe: alternative to listbox Pin
Bill Dean4-May-04 15:50
Bill Dean4-May-04 15:50 
GeneralRe: alternative to listbox Pin
Heath Stewart4-May-04 17:03
protectorHeath Stewart4-May-04 17:03 
GeneralRe: alternative to listbox Pin
mookeroo5-May-04 1:36
mookeroo5-May-04 1:36 
GeneralRe: alternative to listbox Pin
Heath Stewart5-May-04 3:12
protectorHeath Stewart5-May-04 3:12 
My apologies, then. I did have this conversation with someone quite some time ago.

Anyway, the ListView is probably what you want. If you're thinking of something like Windows Media Player or RealOne uses (keeps it's selection after loosing focus), then you definitely want the ListView. Hooking up events to either is a cinche, but the ListView does have an ItemClick event making it a little easier. Also, you can store sub-items (like you'd see for the file size, modified date, and file type in Windows Explorer which also uses the List-View common control) which might be a good place to keep the filename, or you could always use the ListViewItem.Tag property which could be anything you want (but won't display).

If you set ListView.HideSelection to false, then when the control loses focus the item is still highlighted (though in a different color defined by the user's display preferences). All the highlighting is done for you already, too. Like I said, WMP, RealOne, Windows Explorer, and many, many other applications use this control probably more than any other complex control.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Message Board tags? Pin
Heath Stewart4-May-04 17:01
protectorHeath Stewart4-May-04 17:01 
GeneralRe: Message Board tags? Pin
CWIZO4-May-04 20:39
CWIZO4-May-04 20:39 
GeneralRe: Message Board tags? Pin
Heath Stewart5-May-04 2:55
protectorHeath Stewart5-May-04 2:55 
GeneralDataGridTextBoxColumn.TextBox .KeyDown event doesnt catch Enter key Pin
blankg4-May-04 12:38
blankg4-May-04 12:38 
GeneralUsing MSMQ with Web Services Pin
MrJJKoolJ4-May-04 12:35
MrJJKoolJ4-May-04 12:35 
GeneralRe: Using MSMQ with Web Services Pin
Heath Stewart4-May-04 16:57
protectorHeath Stewart4-May-04 16:57 
GeneralViewing computers in a workgroup Pin
User 9625784-May-04 12:15
User 9625784-May-04 12:15 
GeneralThis should be easy Pin
Neil Van Eps4-May-04 10:45
Neil Van Eps4-May-04 10:45 
GeneralRe: This should be easy Pin
leppie4-May-04 11:59
leppie4-May-04 11:59 
GeneralRe: This should be easy Pin
Heath Stewart4-May-04 16:31
protectorHeath Stewart4-May-04 16:31 
GeneralRe: This should be easy Pin
Neil Van Eps11-May-04 8:54
Neil Van Eps11-May-04 8:54 
GeneralRe: This should be easy Pin
Heath Stewart11-May-04 8:56
protectorHeath Stewart11-May-04 8:56 
Generalexport to Excel Pin
econnor4-May-04 9:24
econnor4-May-04 9:24 
GeneralRe: export to Excel Pin
Heath Stewart4-May-04 9:35
protectorHeath Stewart4-May-04 9:35 
GeneralRe: export to Excel Pin
econnor4-May-04 10:21
econnor4-May-04 10:21 
GeneralRe: export to Excel Pin
Heath Stewart4-May-04 10:25
protectorHeath Stewart4-May-04 10:25 
GeneralArchitecture question Pin
Jeff Varszegi4-May-04 9:07
professionalJeff Varszegi4-May-04 9:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.