Problem with ListView

T

Todd Barlow

Hi,
When I try to set the BackgroundImage property on a ListView, the
project fails to run. Sometimes a generic error message appears telling
me that memory might be corrupt. Sometimes the error message does not
appear but the project still does not run.

When I reset the property to that there is no background image, the
projects runs.

There is one form in the project. The ListView is the only control on
the form. There is no other code in the project.

I'm using .NET 2.0.

Any idea about what is happening and how to fix it?
 
T

Todd Barlow

There is no code involved.

Steps
1. Open form in design mode
2. Open Toolbox
3. Add Listview from Toolbox onto form
4. Using Properties view, set backgroundimage to an image on my hard
drive. Image appears inside the listview in the form while in design mode.
5. Click on > button to run project.
6. Project does not run.
 
T

Todd Barlow

For the sake of completeness, I should add:
7. Reset backgroundimage property so that there is no image.
8. Click on > button.
9. Project runs.

There are no other controls on the form.
There are no other forms in the project.
There is no code in the form or elsewhere in the project.

The image file opens in other applications, e.g., Photoshop.
 
A

AlexS

I can't repeat your problem.

I used this code

view.BackgroundImage = Pgm.Properties.Resources.BackList;
view.BackgroundImageTiled = true;

And image is sitting in resources - BackList.

So, I guess, next question is what do you mean by "6. Project does not run"?

Alex
 
T

Todd Barlow

Project does not run = Visual Studio flashes briefly then goes back into
coding mode.

I talked with MS tech support.

The problem occurred here
System.Windows.Forms.UnsafeNativeMethods.SetForegroundWindow(HandleRef hWnd)

We worked through several possible scenarios.

Most likely, it appears that Visual Tasktips v1.0 was causing a problem.

I uninstalled it and everything worked fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top