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. Visual Basic
  4. Panel in a Form loses contents

Panel in a Form loses contents

Scheduled Pinned Locked Moved Visual Basic
helpvisual-studioquestion
5 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.
  • H Offline
    H Offline
    Hurricane3000
    wrote on last edited by
    #1

    Hi all, I have e little problem that I hope someone can help me to solve it. I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline. The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost. What can/must I do to avoid this problem? I am developing in VB of VS 2008. Thanks

    L 1 Reply Last reply
    0
    • H Hurricane3000

      Hi all, I have e little problem that I hope someone can help me to solve it. I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline. The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost. What can/must I do to avoid this problem? I am developing in VB of VS 2008. Thanks

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

      Repaint whenever the OnPaint event fires.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      H 1 Reply Last reply
      0
      • L Lost User

        Repaint whenever the OnPaint event fires.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

        H Offline
        H Offline
        Hurricane3000
        wrote on last edited by
        #3

        Thanks, I will try (I am not expert). Refresh is the same of Repaint?

        D 1 Reply Last reply
        0
        • H Hurricane3000

          Thanks, I will try (I am not expert). Refresh is the same of Repaint?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.

          A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          H 1 Reply Last reply
          0
          • D Dave Kreskowiak

            No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.

            A guide to posting questions on CodeProject

            Click this: Asking questions is a skill. Seriously, do it.
            Dave Kreskowiak

            H Offline
            H Offline
            Hurricane3000
            wrote on last edited by
            #5

            Thanks all for help. Regards

            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