My Final Suggestion: Create your own usercontrol extending the ListViewItem. Add a property called IAMSELECTED and when set to true, you apply those settings. When false, set back to default.
Narzul simply asked how to select an item programmatically in a listview, how do you know he wants to do this from another form? He never mentions that anywhere in his post, and also, I don't believe there is an issue with losing focus on the control... the form maybe. I think your method would be needed if you wanted to do this without having focus on the form, I'm not sure. I suppose if you had a reference to that control, the Select() would still work, I have not tried that myself. Anyways, I thought that I'd throw that out there in case he hadn't thought of that. It's a much easier way to select an item in a listview if you are on the same form. Perhaps I could refrain from using "the right way" in future posts, as we all know there are many many ways to do the same thing.
I see you on here a lot, and you are one the better programmers, and your help is always most appreciated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.