At long last, here it is: the TransparentListView control I promised to share in this thread, quite a long time ago. Special thanks to kleinma and other forum members who contributed to this project. Here's a screenshot of where it stands at the moment:
The only known issues which I couldn't tackle were intermittent designer issues, such as lack of ListViewItem transparency in the designer, and the issue of selecting an item when the TransparentListView is scrolled to the right. I have sorted out everything to the best of my ability. If anyone can help with these issues and any new ones which may arise, please feel free to do whatever you can to help fix them.
Here's a short tutorial to using the control:
The TransparentListView is actually completely transparent. The TransparentListView is located on a Panel control which provides the effect in the screenshot. You can also use gamma effects (available here), gradient effects or any other effect which may be applied to a Panel. The HighlightColor property will enable you to set a custom ARGB color for highlights. The RedrawInterval is the time interval (in ms) after which to redraw the TransparentListView during and after scrolling. Its default value should be 15 (providing appx 60Hz). If you experience choppy redraws, decrease it - take care though, decreasing it below 6-7ms may result in extreme CPU use. Higher values are recommended for slow CPUs.
If you experience issues when adding a TransparentListView via the designer, add a ListView instead, and then alter the designer code, changing the ListView to a TransparentListView, and reload the form.
EDIT: Note that I developed this control for an application that required only the Details view, so I have not tested the correctness of the owner drawing code for the other views.
***
Everyone may use this control for any use he/she sees fit, I would just ask to be credited in their release for the original code of the TransparentListView.
***
Here is v1.0 of the TransparentListView, along with a DLL and XML comments (in the zip file). Please disregard the code which is commented out, it is a leftover of tweaks and experiments with the TransparentListView.
Enjoy and use it well!
Last edited by obi1kenobi; Jan 4th, 2010 at 11:01 AM.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
Is there something weird about the FullRowSelect that I don't know about. I see in your screenshot that the entire row is selected, but when I add your control to the form and set the property, it doesn't show that when I select an item.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Have you set the HighlightColor property? If you can post your current code I can try to look into it. If you'd like, I can also post the code or even the entire project that I used to create the form in the screenshot.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
Can someone help me to make the control available in the Form Designer Windows, and otherwise use correctly it in my project?
I have managed to add the control (Tools-Choose Toolbox Items-Browse, and then added the dll), but when I try to build, I get "'TransparentListView.TransparentListView' is not defined".
In the Project properties-References, TransparentListView is listed.
Project-Add Reference-Browse, and adding the dll does not make any difference.
I'm assuming the "definition" the error message refers to is in the xml file, but how do I get VB to pick that up?
I use VB 2010 Express, and am a newbie with Visual Studio, coming from a VBA background.
Hmm this has happened to me as well in VS2008 - it was a bug in VS and not in the TLV code. I fixed it by restarting VS, so maybe that will help. If it doesn't, zip your project and post it sans the bin and obj folders.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
Hmm this has happened to me as well in VS2008 - it was a bug in VS and not in the TLV code. I fixed it by restarting VS, so maybe that will help. If it doesn't, zip your project and post it sans the bin and obj folders.
Thanks - restarting kind of fixed it. I got compile warnings about changing the control initialization code manually, but once I ignored those, and the subsequent error messages from the form designer as well, it seems to be working.
I can't believe I did not try that myself... :-(
Anyway, the control looks fine so far, and I am now very curious about the performance once I start to use it "for real" - I'm hopeful though!
Thanks (for the help and for writing it in the first place) - Peter
It's ok, it took me a while to think of it myself the first time
As for performance, I encountered no issues on machines built during the last 5 years. If you are experiencing performance issues on your machine, you should increase the RedrawInterval from the default 15 to 30 and maybe even 50. The side-effects will be intermittent choppy redraws, but you will cut down on redraws by a factor of 2 (or 4 if you set it to 50). I wouldn't recommend setting the interval to a value greater than 50, since 50ms between redraws corresponds to 20fps, anything below that would very probably create persistent choppy redraws which I figure you'd want to avoid.
Good luck with your project
Please rate helpful ppl's posts. It's the best 'thank you' you can give
It's exactly what I am looking for! Thanks a lot!
However, when I add this control to my window form. I use "details" view. The entire row is black. Is there anything I miss?
I am using VS2008 in Window Vista.
Besides, would you mind to post the source code?
Are both XP and Vista can run this control?
The source code is attached to the first post, right above the link to the dll.
Would you mind posting the source you are using to display the control? If I remember correctly, you need to choose a color for the highlight, otherwise it defaults to black.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
Thanks! After delete and drag and drop the control from toolbox again, I get a transparent listview.
Is it support "Checkbox"? I can see the checkbox in design view but NOT in run-time. Is there something I miss again?
Yvonne
I've never actually tried it with checkboxes, I think it won't work because the control is doing some custom drawing and I never actually wrote the code for checkboxes to be drawn. You're welcome to edit the control and add checkbox support if you want.
Best of luck with your project!
Please rate helpful ppl's posts. It's the best 'thank you' you can give
hello brother, forgive the daring, a bit better your listview, I would review it and wanted to be able to do something more complete. ListViewTransparente.vb
I would appreciate it if you add a comment in the source explaining exactly what you changed, otherwise it will become increasingly harder and harder to keep track of changes.
Also, you should explain in this forum why your ListView control is better and possibly provide screenshots to demonstrate. This way, everyone has to download your source and create a test project, just to see what you changed...
Thanks for the effort to make the control better!
Please rate helpful ppl's posts. It's the best 'thank you' you can give
I add an image of how you see the control now. and leave the code for review and try it. I'm new to the forum and do not know how you handled it. thanks and greetings
Could you please explain exactly what you changed and how that improves the control? I might be missing something, but I see no difference between your screenshot and the one at the top of the thread...
Please rate helpful ppl's posts. It's the best 'thank you' you can give
improving the design of icons, which had them in the code I downloaded from this post.
the 'highlight' of the rows were not done which is why a new form was implemented.
was eliminated by putting a little flicker less so the interval is not distinguishable.
I would like to review and compare with yours so it will be more noticeable changes.