Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Intermittent paint problem

Intermittent paint problem

Scheduled Pinned Locked Moved C#
helpquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kanchoette
    wrote on last edited by
    #1

    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)

    S C 2 Replies Last reply
    0
    • K kanchoette

      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)

      S Offline
      S Offline
      Super Lloyd
      wrote on last edited by
      #2

      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.

      K 1 Reply Last reply
      0
      • S Super Lloyd

        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.

        K Offline
        K Offline
        kanchoette
        wrote on last edited by
        #3

        Is this fixable? It's driving the users nuts.

        S 1 Reply Last reply
        0
        • K kanchoette

          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)

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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

          S 1 Reply Last reply
          0
          • K kanchoette

            Is this fixable? It's driving the users nuts.

            S Offline
            S Offline
            Super Lloyd
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • C Christian Graus

              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

              S Offline
              S Offline
              Super Lloyd
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups