473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with ListView

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?
Jun 6 '07 #1
5 1643
Can you post relevant code?
It works seamlessly here.
"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
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?

Jun 6 '07 #2
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.

AlexS wrote:
Can you post relevant code?
It works seamlessly here.
"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
>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?

Jun 7 '07 #3
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.

Todd Barlow wrote:
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.

AlexS wrote:
>Can you post relevant code?
It works seamlessly here.
"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
>>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?

Jun 7 '07 #4
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

"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
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.

Todd Barlow wrote:
>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.

AlexS wrote:
>>Can you post relevant code?
It works seamlessly here.
"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
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?

Jun 7 '07 #5
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.SetForegr oundWindow(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.

AlexS wrote:
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

"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
>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.

Todd Barlow wrote:
>>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.

AlexS wrote:
Can you post relevant code?
It works seamlessly here.
"Todd Barlow" <to*********@sas.comwrote in message
news:f4**********@foggy.unx.sas.com...
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?
>

Jun 14 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
1
by: newbie001 | last post by:
I have the following code in a listview control's initList function (called from form_load event). i can't understand why the listview box still appears blank with no columns or listview items. ...
1
by: J_Max | last post by:
Hello, This might be a really easy question, but... I am developing a simple Smart Device application that uses a listview. I have a function that adds a item to the listview - code is below. I...
3
by: Larry | last post by:
I've set up a list of image filesnames in a listview control(lvSrcFileList), I'm using the selectedIndexChange event to select which file is being displayed in a picturebox control(pbImagePreview)....
7
by: David Schwartz | last post by:
I am using a few ActiveX ListViews in my VB.NET Windows Forms application. I have the ListView's HotTracking property set to False, yet when I move the mouse over an item in the ListView (without...
2
by: Matt Michael | last post by:
Hi, I'm having a problem working with a listview in an application I'm writing. Currently, whenever the selectedindex changed event fires, it loads up a htmledit control, and other labels on the...
7
by: Dino Buljubasic | last post by:
Hi, I am using C# 2.0 (VS2005) to build my user control that contains a number of dynamically loaded ListViews. ListViewItems have their ForeColor properties set to either black or blue to...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
2
by: Paul W | last post by:
Hello, My problem concerns the shell. If there's a better forum for this post, please let me know. I'm trying to create a ListView control that displays the contents of a folder with all the...
0
by: =?Utf-8?B?SWdvcg==?= | last post by:
Hi everyone! I have some strange behavior of ListView control in WPF. We are developing application in C#. I created ListView with some items and set SelectedIndex to some index in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.