Results 1 to 10 of 10

Thread: ListView BackgroundImage [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Resolved ListView BackgroundImage [RESOLVED]

    Why isn't this working...

    VB Code:
    1. ListView1.BackgroundImage = Image.FromFile("c:\tst.bmp")

    ...

    I've found this:

    http://dotnet.mvps.org/dotnet/faqs/?...dimage&lang=en

    on the forums...


    but the listview DOES have the BackgroundImage property... What's it use if it doesn't work the way I tired?
    Last edited by Ruku; Jan 2nd, 2006 at 12:55 AM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  2. #2
    Lively Member
    Join Date
    Dec 2005
    Location
    UK
    Posts
    127

    Re: ListView BackgroundImage [UNRESOLVED]

    try this mate might just be that the control will accept bitmaps rather than images

    Dim oBMP As New Bitmap(sFileName)
    ListView1.BackgroundImage = obmp

  3. #3
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: ListView BackgroundImage [UNRESOLVED]

    Worked for me using a jpg. Visual Studio 2005 listview has a background image property, the 2003 control does not. In 2005, it worked fine and loaded my test jpg into the listview background...
    VB Code:
    1. 'worked fine in 2005 express
    2. ListView1.BackgroundImage = Image.FromFile("c:\test.jpg")
    Are you sure you gave it the right file path? I do realize you are missing an "e" if you meant "test.bmp"... but even if that is correct, if you are using 2005, then it should still work...

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: ListView BackgroundImage [UNRESOLVED]

    I'm running 2003 1.1 and it doesnt work like this either.
    VB Code:
    1. Dim pic As Bitmap = New Bitmap("C:\Greenstone.bmp")
    2. Me.ListView1.BackgroundImage = pic
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: ListView BackgroundImage [UNRESOLVED]

    Is it just me or do I not see a background image property for a listview in 2003?

    ***EDIT - k I was only looking in designer, I see it now

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: ListView BackgroundImage [UNRESOLVED]

    The ListView has to have a BackgroundImage property because it is inherited from the Control class. It is just not displayed in the designer because it has been overridden to have no effect, which is why setting it in code does nothing. Presumably Microsoft decided to reinstate the property's behaviour in .NET 2.0 as people must have wanted it and complained about it not having an effect in .NET 1.x.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: ListView BackgroundImage [UNRESOLVED]

    yeah, I guess... bah well...

    I got 2003... If you wanna have the BG in 2003, try this link:
    http://dotnet.mvps.org/dotnet/faqs/?...dimage&lang=en

    Last edited by Ruku; Jan 2nd, 2006 at 01:11 AM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: ListView BackgroundImage [RESOLVED]

    The link doesnt work but looks like the same one from post #1?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: ListView BackgroundImage [RESOLVED]

    w00t!

    copyed it including the "..."

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: ListView BackgroundImage [RESOLVED]

    Oh, so it was the same original link. Thanks
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width