Click here to Skip to main content
15,913,836 members
Home / Discussions / C#
   

C#

 
QuestionWin32 API? Pin
andyvm13-Jul-07 15:33
andyvm13-Jul-07 15:33 
AnswerRe: Win32 API? Pin
Ky Nam14-Jul-07 4:42
Ky Nam14-Jul-07 4:42 
Questionmore datails about flash files properties Pin
monamour13-Jul-07 15:30
monamour13-Jul-07 15:30 
Questionlistview item backcolor - XP problem [modified] Pin
Glen Harvy13-Jul-07 15:07
Glen Harvy13-Jul-07 15:07 
AnswerRe: listview item backcolor - XP problem Pin
martin_hughes14-Jul-07 2:50
martin_hughes14-Jul-07 2:50 
GeneralRe: listview item backcolor - XP problem Pin
Glen Harvy14-Jul-07 3:56
Glen Harvy14-Jul-07 3:56 
GeneralRe: listview item backcolor - XP problem Pin
martin_hughes14-Jul-07 4:35
martin_hughes14-Jul-07 4:35 
GeneralRe: listview item backcolor - XP problem Pin
Glen Harvy14-Jul-07 5:17
Glen Harvy14-Jul-07 5:17 
I thank you for your time and effort - the fact that it worked for you got me thinking. So this is what I did:

1. Created a new project2 and copied most of the code from project1 in question to a new listview. Everything worked fine so that eliminated my computer. Must be the code somewhere.

2. Went back to my original project1 and commented out the foreach .. loop and copied the code from project2 and it still didn't work.

3. The code worked on project2 - so why not project1.

4. Quadruple checked all the configuration of the two listviews in 1 and 2. I swear they were the same.

5. OK. Create new listview in project1 alongside of the original and used the same code as in project2. - New listview worked. Old listview no good - new listview OK.

6. Used new code (modified) to fill new listview from the table. New listview still works fine with new data.

7. Dragged old listview to vacant part of screen and moved new listview to old listview position. In this action I did something that created an event on new listview. No worries - just deleted the event from the new listview.

8. Now BOTH listviews are working as they should be.

I'll swear I didn't change anything on the old listview.

It's 1:05 am here so I'm going to bed. I am going to get a copy of the backup code tomorrow and compare the two designer code sections - there's gotta be something in there that caused this.

There is one other thing. The new listview was outside of a group box but having "swaped" the two listviews, the problem has not returned.

For the record - here's the code that now works for BOTH listviews:

int i = 0;
foreach (DataRow dr in myWebLoggerDataSet.MonitorList.Rows)
{
string name = dr["Name"].ToString();
string size = dr["FileSize"].ToString();
string colour = dr["Colour"].ToString();
string display = name + " : " + size;
string[] myItems = new string[]
{
display
};
string test = "Bozo";
//ListViewItem lvi = new ListViewItem(myItems); //,0,Color.Black, Color.Pink,Font);
////lvi.UseItemStyleForSubItems = true;
////lvi.BackColor = Color.FromArgb(Convert.ToInt32(colour));
//this.lvResourceMonitor.Items.Add(lvi);
//lvi.BackColor = Color.FromArgb(Convert.ToInt32(colour));
//lvResourceMonitor.Refresh();
this.lvResourceMonitor.Items.Add(display);
this.lvResourceMonitor.Items[i].BackColor = Color.Chartreuse;
this.lvResourceMonitor.Refresh();


lv1.Items.Add(display);
lv1.Items[i].BackColor = Color.FromArgb(Convert.ToInt32(colour));
lv1.Refresh();
i++;


}

The ListviewItem array lvi was not the cause of the problem as far as I can tell. I'm pretty sure of this because I used the new code to fill the old listview without success.

I'm off to bed - once again - thanks for helping me.

Regards,



Glen Harvy

GeneralRe: listview item backcolor - XP problem Pin
martin_hughes14-Jul-07 9:51
martin_hughes14-Jul-07 9:51 
QuestionProblems with GUI class design Pin
User 665813-Jul-07 14:06
User 665813-Jul-07 14:06 
AnswerRe: Problems with GUI class design Pin
Luc Pattyn13-Jul-07 14:38
sitebuilderLuc Pattyn13-Jul-07 14:38 
GeneralRe: Problems with GUI class design Pin
User 665814-Jul-07 0:21
User 665814-Jul-07 0:21 
GeneralRe: Problems with GUI class design Pin
Luc Pattyn14-Jul-07 1:36
sitebuilderLuc Pattyn14-Jul-07 1:36 
GeneralRe: Problems with GUI class design Pin
User 665814-Jul-07 3:20
User 665814-Jul-07 3:20 
QuestionVideo Pin
Leslie Sanford13-Jul-07 11:15
Leslie Sanford13-Jul-07 11:15 
Questioncompression Pin
mkl_0713-Jul-07 10:24
mkl_0713-Jul-07 10:24 
AnswerRe: compression Pin
Paul Conrad13-Jul-07 10:31
professionalPaul Conrad13-Jul-07 10:31 
Question[How] Screen reading for automation tasks? Pin
sbscb13-Jul-07 9:59
sbscb13-Jul-07 9:59 
AnswerRe: [How] Screen reading for automation tasks? Pin
Shy Agam13-Jul-07 11:08
Shy Agam13-Jul-07 11:08 
QuestionConcating strings... Pin
Shy Agam13-Jul-07 9:13
Shy Agam13-Jul-07 9:13 
AnswerRe: Concating strings... Pin
PIEBALDconsult13-Jul-07 9:32
mvePIEBALDconsult13-Jul-07 9:32 
AnswerRe: Concating strings... Pin
Guffa13-Jul-07 10:25
Guffa13-Jul-07 10:25 
AnswerRe: Concating strings... Pin
Luc Pattyn13-Jul-07 10:35
sitebuilderLuc Pattyn13-Jul-07 10:35 
QuestionA query regarding deployment!!! Pin
haseebbutt00713-Jul-07 8:02
haseebbutt00713-Jul-07 8:02 
AnswerRe: A query regarding deployment!!! Pin
Dave Kreskowiak13-Jul-07 8:11
mveDave Kreskowiak13-Jul-07 8:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.