Intermittent paint problem
-
I am using item.SubItems.Add('\x6E'.ToString(), Color.FromArgb(row.DiaryActionRow.Color), diaryListView.BackColor, colorFont); to display a coloured square within a listView column. It works fine, but now and then the listview displays a large red cross instead of the required columns and contents. Anyone know why this is please? (I'm using VS8 to create the application)
-
I am using item.SubItems.Add('\x6E'.ToString(), Color.FromArgb(row.DiaryActionRow.Color), diaryListView.BackColor, colorFont); to display a coloured square within a listView column. It works fine, but now and then the listview displays a large red cross instead of the required columns and contents. Anyone know why this is please? (I'm using VS8 to create the application)
I bet you are using a WinForm control, such as the System.Windows.Forms.ListView, is it? In such case the red crass is a symptoms of an exception when painting... (in OnPaint, or in some native code for some build-in control)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
I bet you are using a WinForm control, such as the System.Windows.Forms.ListView, is it? In such case the red crass is a symptoms of an exception when painting... (in OnPaint, or in some native code for some build-in control)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Is this fixable? It's driving the users nuts.
-
I am using item.SubItems.Add('\x6E'.ToString(), Color.FromArgb(row.DiaryActionRow.Color), diaryListView.BackColor, colorFont); to display a coloured square within a listView column. It works fine, but now and then the listview displays a large red cross instead of the required columns and contents. Anyone know why this is please? (I'm using VS8 to create the application)
If you want a red square, might just using a space with a back color of whatever you want, work better ? The other option is to owner draw the control, I guess,
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
Is this fixable? It's driving the users nuts.
catch the exception, analyze it, fix it! if it's your own control use a try/catch in OnPaint! ;-) if it's a 3rd party control, mmh...handling of unhandled exception is a topic which change with every version of the .NET framework so it's hard to help with little detail you give. but perhaps you might have some luck with: System.Windows.Forms.Application.( ThreadException SetUNhandledExceptionMode ) and/or AppDomain.UnhandledException
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
If you want a red square, might just using a space with a back color of whatever you want, work better ? The other option is to owner draw the control, I guess,
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
is it "tongue in cheek" humor? Note: it's not a question whether it's humor or not, but a question to check if I'm using the right expression! (Still learning English, I am!)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.