[2008] Transparent ListView-VBForums
Results 1 to 28 of 28

Thread: [2008] Transparent ListView

  1. #1

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Post [2008] Transparent ListView

    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:

    Name:  TransparentListView scr.jpg
Views: 4187
Size:  341.4 KB

    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!
    Attached Files Attached Files
    Last edited by obi1kenobi; Jan 4th, 2010 at 10:01 AM.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  2. #2
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,272

    Re: [2008] Transparent ListView

    Looks nice!
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  3. #3

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    Thanks I couldn't have done it without your help though...
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  4. #4
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,272

    Re: [2008] Transparent ListView

    well that is what this forum is all about
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  5. #5
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,485

    Re: [2008] Transparent ListView

    That's an A+ control there! Congrats!
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  6. #6

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    Thanks
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  7. #7
    Registered User
    Join Date
    Jul 2009
    Posts
    71

    Thumbs up Re: [2008] Transparent ListView

    That's amazing - I actually needed this in my application and by accident I see this! Perfect, I'm going to use it in my application!

  8. #8

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    I'm glad you found it helpful Happy coding
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  9. #9
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    3,817

    Re: [2008] Transparent ListView

    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.

  10. #10

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  11. #11

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    @JuggaloBrotha: Did you solve the problem you had with the control? You left me wondering... I cannot reproduce your problem on any of my two PCs.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  12. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    3,817

    Re: [2008] Transparent ListView

    Quote Originally Posted by obi1kenobi View Post
    @JuggaloBrotha: Did you solve the problem you had with the control? You left me wondering... I cannot reproduce your problem on any of my two PCs.
    I think so, I'll fiddle with it today and see if it still occurs. I got side tracked with req. changes in other apps.

  13. #13
    New Member
    Join Date
    Dec 2010
    Posts
    2

    Re: [2008] Transparent ListView

    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.

  14. #14

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  15. #15
    New Member
    Join Date
    Dec 2010
    Posts
    2

    Re: [2008] Transparent ListView

    Quote Originally Posted by obi1kenobi View Post
    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

  16. #16

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  17. #17
    New Member
    Join Date
    Oct 2011
    Posts
    2

    Re: [2008] Transparent ListView

    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?

    Thanks a lots!

    Yvonne

  18. #18

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  19. #19
    New Member
    Join Date
    Oct 2011
    Posts
    2

    Re: [2008] Transparent ListView

    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

  20. #20

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    It's confirmed to run both under XP and Vista/W7.

    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

  21. #21
    New Member
    Join Date
    Oct 2011
    Posts
    7

    Re: [2008] Transparent ListView

    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

  22. #22

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  23. #23
    New Member
    Join Date
    Oct 2011
    Posts
    7

    Re: [2008] Transparent ListView

    there is no problem brother, I'll do that without problems. and comment the code

  24. #24
    New Member
    Join Date
    Oct 2011
    Posts
    7

    Re: [2008] Transparent ListView

    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

    Name:  listviewtransparente.gif
Views: 2216
Size:  117.6 KB



  25. #25

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    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

  26. #26
    New Member
    Join Date
    Oct 2011
    Posts
    7

    Re: [2008] Transparent ListView

    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.

  27. #27

    Thread Starter
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] Transparent ListView

    Sure, go for it Btw, the highlight of the rows was in fact implemented and working, you may not have been using it correctly.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  28. #28
    New Member
    Join Date
    Oct 2011
    Posts
    7

    Re: [2008] Transparent ListView

    possibly, but I liked the highlight is degraded more personalized, just needs to be done.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.