Listview control background image

  • Thread starter Thread starter m. pollack
  • Start date Start date
M

m. pollack

Hi,

I am using a System.Windows.Forms.ListView control and
would like to put an image in the background. Although the
BackgroundImage property is not exposed in the IDE
Properties window for the control, I figured that the
Listview, being descended from the Control class, should
implement the property, so I used the following code in my
form's constructor (after InitializeComponent(), of
course):

listView1.BackgroundImage = Image.FromFile
(@"C:\test2.bmp");

But nothing happens. I also tried this:

listView1.BackgroundImage = new Bitmap(@"C:\test2.bmp");

But the background is still blank. Any ideas?

Thanks, MP
 
Hi MP,
Only few controls support this property though there are
many controls that inherit Control class. Unfortunately,
ListView control is one of them. Button, CheckBox, Form
GroupBox, Panel, PictureBox, RadioButton,
TabPage are some controls that support BackgroundImage
Property.
Hope that helps
Have a great day :)
R. Pooran Prasad
Itreya Technologies Pvt Ltd.,
Mail: (e-mail address removed)
Phone(Off) : 5200179/80/81/82/83 Extn: 42
Mobile: +91 98860 29578
 
* "m. pollack said:
I am using a System.Windows.Forms.ListView control and
would like to put an image in the background. Although the
BackgroundImage property is not exposed in the IDE
Properties window for the control, I figured that the
Listview, being descended from the Control class, should
implement the property, so I used the following code in my
form's constructor (after InitializeComponent(), of
course):

The property is not "implemented". You will have to use p/invoke:

<http://groups.google.com/groups?selm=eCS#[email protected]>
 
Back
Top