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. Owner Draw Control Problems

Owner Draw Control Problems

Scheduled Pinned Locked Moved C#
graphicshelpquestion
5 Posts 2 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.
  • F Offline
    F Offline
    freshthinking
    wrote on last edited by
    #1

    I've created a number of overdrawn controls (status bar, group box) and they drawn fine, and as i want. However if you move another window over the window with these controls, you get odd kinda painting on the controls, kinda like window borders left over, etc. I would guess by getting all the controls to redraw themeselves would work, but I can't seem to get this sorted. i tried overidding the OnGotFocus in the main form on which these controls reside to call Invalidate(true), but it doesn't seem to work. Any ideas?? [Edit] I've managed to solve this by calling the Invalidate in the Frosm Activate event. However I still the same problem when say a drop down box (an owner drawn one) drops the list over the owner drawn controls. is there anyway of solving this short of calling invalidate alot, which. All the owner drawing is done by overriding the OnPaint in the pretty standard way. [/Edit]

    J 1 Reply Last reply
    0
    • F freshthinking

      I've created a number of overdrawn controls (status bar, group box) and they drawn fine, and as i want. However if you move another window over the window with these controls, you get odd kinda painting on the controls, kinda like window borders left over, etc. I would guess by getting all the controls to redraw themeselves would work, but I can't seem to get this sorted. i tried overidding the OnGotFocus in the main form on which these controls reside to call Invalidate(true), but it doesn't seem to work. Any ideas?? [Edit] I've managed to solve this by calling the Invalidate in the Frosm Activate event. However I still the same problem when say a drop down box (an owner drawn one) drops the list over the owner drawn controls. is there anyway of solving this short of calling invalidate alot, which. All the owner drawing is done by overriding the OnPaint in the pretty standard way. [/Edit]

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      You need to do this in the constructor:

      this.SetStyle(ControlStyles.AllPaintingInWmPaint |
      ControlStyles.UserPaint |
      ControlStyles.DoubleBuffer,true);

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      F 1 Reply Last reply
      0
      • J J Dunlap

        You need to do this in the constructor:

        this.SetStyle(ControlStyles.AllPaintingInWmPaint |
        ControlStyles.UserPaint |
        ControlStyles.DoubleBuffer,true);

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        F Offline
        F Offline
        freshthinking
        wrote on last edited by
        #3

        There all ready set in the constructor. Thats why it's puzzling me a little.

        J 1 Reply Last reply
        0
        • F freshthinking

          There all ready set in the constructor. Thats why it's puzzling me a little.

          J Offline
          J Offline
          J Dunlap
          wrote on last edited by
          #4

          You don't know how many times I've gone through owner draw problems like this. That's why I'm glad we're now re-implementing all Windows controls from scratch[^], with full owner draw/skinning capabilities. I've been named design leader for the project.

          "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
          "You must be the change you wish to see in the world." - Mahatma Gandhi

          F 1 Reply Last reply
          0
          • J J Dunlap

            You don't know how many times I've gone through owner draw problems like this. That's why I'm glad we're now re-implementing all Windows controls from scratch[^], with full owner draw/skinning capabilities. I've been named design leader for the project.

            "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
            "You must be the change you wish to see in the world." - Mahatma Gandhi

            F Offline
            F Offline
            freshthinking
            wrote on last edited by
            #5

            Sounds like a good idea. I'll be sure to follow the project. Will you guys be posting your progress? if you want testers in the future let me know.

            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