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. GDI Interface

GDI Interface

Scheduled Pinned Locked Moved C#
graphicsdata-structureshelpquestion
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.
  • C Offline
    C Offline
    cshivaprasad
    wrote on last edited by
    #1

    I am drawing a binary tree on form. but when i resize form window to small and resize it back, the portion of drawing which is in resize area, is got erased. how can i get that drawing back.. Pls help me out

    A M 2 Replies Last reply
    0
    • C cshivaprasad

      I am drawing a binary tree on form. but when i resize form window to small and resize it back, the portion of drawing which is in resize area, is got erased. how can i get that drawing back.. Pls help me out

      A Offline
      A Offline
      alexey N
      wrote on last edited by
      #2

      Repaint form on Resize event. Best regards, A_l_e_x_e_y_.

      C 1 Reply Last reply
      0
      • A alexey N

        Repaint form on Resize event. Best regards, A_l_e_x_e_y_.

        C Offline
        C Offline
        cshivaprasad
        wrote on last edited by
        #3

        There is no repaint method for form object. How can i repaint

        A 1 Reply Last reply
        0
        • C cshivaprasad

          There is no repaint method for form object. How can i repaint

          A Offline
          A Offline
          alexey N
          wrote on last edited by
          #4

          Call Invalidate() method. And if you painting in form event Paint - your code repaint your tree. If you got flickering set form DoubleBuffered property to true. Why don't you use UserControl, instead of painting on form ? Best regards, Alexey.

          1 Reply Last reply
          0
          • C cshivaprasad

            I am drawing a binary tree on form. but when i resize form window to small and resize it back, the portion of drawing which is in resize area, is got erased. how can i get that drawing back.. Pls help me out

            M Offline
            M Offline
            microsoc
            wrote on last edited by
            #5

            Hi cshivaprasad! :) If you're inherting from a form, add these lines of code to your constructor.

            SetStyle(ControlStyles.ResizeRedraw, true);

            this will automatically repaint your form when it's resize.

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

            this will prevent the flickering of your form. hope these help! :) microsoc :cool:

            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