Highlight text only in a listview subitem
-
Hi There, I'm about to make a small application Windows Form/C# to keep different kind of informations such as passwords credit card info etc. It is rather simple with a treeview on the left side and a listview on the right side. Now I implement 'Search' and 'Find next' and it works fine so far in both views. However when I find and highlight a hit in a listview subitem the entire cell (background) is highlighted but I only want to highlight the text itself. (I would like to add some screen shots but I don't know how to do it). Any ideas how to solve this (code example are very much appreciated)? Thanks in advance,
-
Hi There, I'm about to make a small application Windows Form/C# to keep different kind of informations such as passwords credit card info etc. It is rather simple with a treeview on the left side and a listview on the right side. Now I implement 'Search' and 'Find next' and it works fine so far in both views. However when I find and highlight a hit in a listview subitem the entire cell (background) is highlighted but I only want to highlight the text itself. (I would like to add some screen shots but I don't know how to do it). Any ideas how to solve this (code example are very much appreciated)? Thanks in advance,
-
Hi Eddy, Thanks for your reply. I already had a look at that link and https://msdn.microsoft.com/en-us/library/system.windows.forms.listview.drawsubitem(v=vs.110).aspx[^] as well. However that example as well as others draws the entire cell in the same color. My problem is that I'm not a very skilled C#/.NET programmer, but I'll try to dig deeper into that subject. When/if I find a solution I'll post it here.
-
Hi There, I'm about to make a small application Windows Form/C# to keep different kind of informations such as passwords credit card info etc. It is rather simple with a treeview on the left side and a listview on the right side. Now I implement 'Search' and 'Find next' and it works fine so far in both views. However when I find and highlight a hit in a listview subitem the entire cell (background) is highlighted but I only want to highlight the text itself. (I would like to add some screen shots but I don't know how to do it). Any ideas how to solve this (code example are very much appreciated)? Thanks in advance,
Take a look here[^] This control can do all that... And a whole lot more! You will have to completely redo anything already using a list view, though, but the added power and flexibility is well worth it. Just take note of the license being GPLv3. I have used this control before, and it is AWESOME!
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
Take a look here[^] This control can do all that... And a whole lot more! You will have to completely redo anything already using a list view, though, but the added power and flexibility is well worth it. Just take note of the license being GPLv3. I have used this control before, and it is AWESOME!
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
Hi Brisingr, Thanks for your reply. I have already had a look at ObjectListView but I discarded it because it also carries a lot of code that I do not need - I hoped for something more simple. But you may be right that it is no other alternatives to do a lot of hard coding myself. Anyway I will once again consider to use it. Thanks :) ,
-
Hi Brisingr, Thanks for your reply. I have already had a look at ObjectListView but I discarded it because it also carries a lot of code that I do not need - I hoped for something more simple. But you may be right that it is no other alternatives to do a lot of hard coding myself. Anyway I will once again consider to use it. Thanks :) ,
Yeah, it is a rather heavy control. But I cut out about 65% of the code in the application I was using it for, so that is a big win. (Yes, 65% of the code was for handling list view related operations, and I was only about 30% done with the program!)
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???