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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. drawline permanently

drawline permanently

Scheduled Pinned Locked Moved C#
7 Posts 4 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.
  • S Offline
    S Offline
    s4_sabahatf
    wrote on last edited by
    #1

    when we draw a line using grahics object,against button & when i refresh that window,the line disappears so i want to ask ,which method is used to permanent draw line

    Q S 2 Replies Last reply
    0
    • S s4_sabahatf

      when we draw a line using grahics object,against button & when i refresh that window,the line disappears so i want to ask ,which method is used to permanent draw line

      Q Offline
      Q Offline
      quiteSmart
      wrote on last edited by
      #2

      sure it will disappear when u use the refresh method cz the refresh methode returns the form to its original view and dispose all its resources as if you are creating a new instance of that form. I am trying to figure out the solution for ur problem but i am not able to do so until now. jamil abou khalil

      1 Reply Last reply
      0
      • S s4_sabahatf

        when we draw a line using grahics object,against button & when i refresh that window,the line disappears so i want to ask ,which method is used to permanent draw line

        S Offline
        S Offline
        sam
        wrote on last edited by
        #3

        draw it in the paint event of the form sameer

        S 1 Reply Last reply
        0
        • S sam

          draw it in the paint event of the form sameer

          S Offline
          S Offline
          s4_sabahatf
          wrote on last edited by
          #4

          ys i did try to draw it in the Onpaint method,but i want to draw against button? then it create problems

          R S 2 Replies Last reply
          0
          • S s4_sabahatf

            ys i did try to draw it in the Onpaint method,but i want to draw against button? then it create problems

            R Offline
            R Offline
            Russell Jones
            wrote on last edited by
            #5

            put it in the button paint method? Russ

            1 Reply Last reply
            0
            • S s4_sabahatf

              ys i did try to draw it in the Onpaint method,but i want to draw against button? then it create problems

              S Offline
              S Offline
              sam
              wrote on last edited by
              #6

              ok do one thing make one class level bool variable like private bool _drwaLineFlag=false; now on button click make it true(drwaLineFlag=true; ) and call the paint method this.Paint(); . and and in Paint Method put a condition against the _drwaLineFlag

              S 1 Reply Last reply
              0
              • S sam

                ok do one thing make one class level bool variable like private bool _drwaLineFlag=false; now on button click make it true(drwaLineFlag=true; ) and call the paint method this.Paint(); . and and in Paint Method put a condition against the _drwaLineFlag

                S Offline
                S Offline
                s4_sabahatf
                wrote on last edited by
                #7

                sam could u provide me a little piece of code for this .plz

                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