ListView BackgroundImage [RESOLVED]
Why isn't this working... :confused:
VB Code:
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?
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
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:
'worked fine in 2005 express
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...
Re: ListView BackgroundImage [UNRESOLVED]
I'm running 2003 1.1 and it doesnt work like this either.
VB Code:
Dim pic As Bitmap = New Bitmap("C:\Greenstone.bmp")
Me.ListView1.BackgroundImage = pic
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 :)
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.
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
:wave:
Re: ListView BackgroundImage [RESOLVED]
The link doesnt work but looks like the same one from post #1?
Re: ListView BackgroundImage [RESOLVED]
w00t!
copyed it including the "..." :bigyello:
Re: ListView BackgroundImage [RESOLVED]
Oh, so it was the same original link. Thanks :)