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. What is the method in C# like the method - "repaint()" in JAVA???

What is the method in C# like the method - "repaint()" in JAVA???

Scheduled Pinned Locked Moved C#
questioncsharpjavahelp
8 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.
  • T Offline
    T Offline
    TAFIN
    wrote on last edited by
    #1

    I was trying to built a "Paint" program that can paint that user wants to paint. but the thing is when my form is minimized or another form is selected over my form the painted portion is removed. In java , i know that if i use "repaint()" function the it as ok, but what to do with C#. sorry for my english. plz help me urgent. Thanks Mahbub-E-Rababni [Tafin]

    L 2 Replies Last reply
    0
    • T TAFIN

      I was trying to built a "Paint" program that can paint that user wants to paint. but the thing is when my form is minimized or another form is selected over my form the painted portion is removed. In java , i know that if i use "repaint()" function the it as ok, but what to do with C#. sorry for my english. plz help me urgent. Thanks Mahbub-E-Rababni [Tafin]

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can use Refresh() or use Event OnPaint()

      T 1 Reply Last reply
      0
      • L Lost User

        You can use Refresh() or use Event OnPaint()

        T Offline
        T Offline
        TAFIN
        wrote on last edited by
        #3

        thanks:thumbsup: OnPaint() can only paint the base form, i can not paint on a panel or a picturbox....what to do??? thanks. Mahbub-E-Rabbani [TAFIN] Bangladesh

        OriginalGriffO 1 Reply Last reply
        0
        • T TAFIN

          thanks:thumbsup: OnPaint() can only paint the base form, i can not paint on a panel or a picturbox....what to do??? thanks. Mahbub-E-Rabbani [TAFIN] Bangladesh

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          TAFIN wrote:

          OnPaint() can only paint the base form, i can not paint on a panel or a picturbox

          Since when? Every control has it's own Paint event.

          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          T 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            TAFIN wrote:

            OnPaint() can only paint the base form, i can not paint on a panel or a picturbox

            Since when? Every control has it's own Paint event.

            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

            T Offline
            T Offline
            TAFIN
            wrote on last edited by
            #5

            i took a form and then a picturebox. i wanted to piant on the picture box that will stay if the form is minimized of sent to back of other forms. the **Event OnPaint()**is used for the base Form Form1 but not for picturebox...and does the Event paint() of picturebox does that waht i want!!! thanks. mahbub-E-Rabbani [TAFIN] Bangladesh

            OriginalGriffO 1 Reply Last reply
            0
            • T TAFIN

              i took a form and then a picturebox. i wanted to piant on the picture box that will stay if the form is minimized of sent to back of other forms. the **Event OnPaint()**is used for the base Form Form1 but not for picturebox...and does the Event paint() of picturebox does that waht i want!!! thanks. mahbub-E-Rabbani [TAFIN] Bangladesh

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              Then use the PictureBox.Paint event - if you must use a picture box at all, rather than painting on the form directly. If you Google for "PictureBox.Paint" the first link is the MSDN example of how to paint on a picturebox[^]

              No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              T 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                Then use the PictureBox.Paint event - if you must use a picture box at all, rather than painting on the form directly. If you Google for "PictureBox.Paint" the first link is the MSDN example of how to paint on a picturebox[^]

                No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

                T Offline
                T Offline
                TAFIN
                wrote on last edited by
                #7

                ok thanks:thumbsup:

                1 Reply Last reply
                0
                • T TAFIN

                  I was trying to built a "Paint" program that can paint that user wants to paint. but the thing is when my form is minimized or another form is selected over my form the painted portion is removed. In java , i know that if i use "repaint()" function the it as ok, but what to do with C#. sorry for my english. plz help me urgent. Thanks Mahbub-E-Rababni [Tafin]

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  C# repaint equivalent is Invalidate.

                  Life is a stage and we are all actors!

                  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