CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Sep 2001
    Location
    Rotmanka, Poland
    Posts
    88

    c# form size change problem

    Hi All !

    I wrote a easy program: one standard form. Next I define a paint method for this form:

    Code:
     bool cl = true;
            private void Form1_Paint(object sender, PaintEventArgs e)
            {
                Brush c;
                if (cl)
                     c = new SolidBrush(Color.Gray);
                else
                     c = new SolidBrush(Color.Green);
    
                cl = !cl;
    
                e.Graphics.FillRectangle(c, new Rectangle(0,0,Width,Height));
                
            }
    So by every screen redraw shoud be one time gray, one time green background. But, when I i.e. change a form size, I see that not full form is redraw everytime, that I have a "zebra" effect (look attachment)


    How to force, that always all will be redraw ?

    THNX in advance
    Olek

    p.s.
    I know, that I can a set a background property for have always same color. THis is not a problem. Problem is with paint somthink else, not only a background. I know also that I can put a Refresh at Resize, but this is also no solution for me - important is for my program not to redraw double.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured