Click here to Skip to main content
15,913,467 members
Home / Discussions / C#
   

C#

 
GeneralRe: regarding hotspot Pin
PIEBALDconsult9-Apr-10 8:25
mvePIEBALDconsult9-Apr-10 8:25 
GeneralRe: regarding hotspot Pin
Som Shekhar9-Apr-10 10:12
Som Shekhar9-Apr-10 10:12 
GeneralRe: regarding hotspot Pin
EliottA9-Apr-10 8:38
EliottA9-Apr-10 8:38 
AnswerRe: regarding hotspot Pin
NavnathKale9-Apr-10 10:06
NavnathKale9-Apr-10 10:06 
Questioncan any one send me sample console application for downloading a file from ftp to local file system Pin
koganti pardhasaradhi9-Apr-10 6:21
koganti pardhasaradhi9-Apr-10 6:21 
AnswerRe: can any one send me sample console application for downloading a file from ftp to local file system Pin
Abhinav S9-Apr-10 6:33
Abhinav S9-Apr-10 6:33 
AnswerRe: can any one send me sample console application for downloading a file from ftp to local file system Pin
leckey9-Apr-10 7:09
leckey9-Apr-10 7:09 
QuestionHow to avoid graphics rectangle flickering on scrolling? Pin
Noemi Katinka9-Apr-10 6:19
Noemi Katinka9-Apr-10 6:19 
Hello,

I have a form on which i draw a rectangle with the help of the graphics.
During scrolling the rectangle is flickering.
My code is the following:

public Form1()
        {
            InitializeComponent();

            AutoScrollMinSize = new Size(1000, 1000);
            SetStyle(
                ControlStyles.AllPaintingInWmPaint | 
                ControlStyles.UserPaint | 
                ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.FillRectangle(Brushes.Red, new Rectangle(0, 0, 30, 30));
        }

        protected override void OnScroll(ScrollEventArgs se)
        {
            Invalidate();
            base.OnScroll(se);
        }

        protected override void OnMouseWheel(MouseEventArgs e)
        {
            Invalidate();
            base.OnMouseWheel(e);
        }


What i don't understand is why the flickering appears when i move the scrollbar with the mouse, but on mouse wheel does't appear.

Why flickers the rectangle on scrolling?

What can i do to avoid flickering on scolling?

Thanks.
AnswerRe: How to avoid graphics rectangle flickering on scrolling? Pin
Som Shekhar9-Apr-10 10:11
Som Shekhar9-Apr-10 10:11 
Questionplease i need the complation of 4 queen [modified] Pin
amrreko9-Apr-10 5:00
amrreko9-Apr-10 5:00 
AnswerRe: please i need the complation of 4 queen Pin
Ian Shlasko9-Apr-10 5:04
Ian Shlasko9-Apr-10 5:04 
AnswerREPOST OF NONSENSICAL QUESTION Pin
Keith Barrow9-Apr-10 5:05
professionalKeith Barrow9-Apr-10 5:05 
AnswerRe: please i need the complation of 4 queen Pin
Dalek Dave9-Apr-10 5:09
professionalDalek Dave9-Apr-10 5:09 
AnswerRe: please i need the complation of 4 queen Pin
R. Giskard Reventlov9-Apr-10 5:14
R. Giskard Reventlov9-Apr-10 5:14 
AnswerRe: please i need the complation of 4 queen Pin
OriginalGriff9-Apr-10 5:16
mveOriginalGriff9-Apr-10 5:16 
AnswerRe: please i need the complation of 4 queen Pin
Sandesh M Patil9-Apr-10 5:19
Sandesh M Patil9-Apr-10 5:19 
GeneralRe: please i need the complation of 4 queen Pin
Smithers-Jones9-Apr-10 5:30
Smithers-Jones9-Apr-10 5:30 
AnswerRe: please i need the complation of 4 queen Pin
Luc Pattyn9-Apr-10 5:29
sitebuilderLuc Pattyn9-Apr-10 5:29 
GeneralRe: please i need the complation of 4 queen Pin
NavnathKale9-Apr-10 22:26
NavnathKale9-Apr-10 22:26 
AnswerRe: please i need the complation of 4 queen Pin
Dave Parker9-Apr-10 5:42
Dave Parker9-Apr-10 5:42 
GeneralRe: please i need the complation of 4 queen Pin
Keith Barrow9-Apr-10 5:44
professionalKeith Barrow9-Apr-10 5:44 
GeneralRe: please i need the complation of 4 queen Pin
PIEBALDconsult9-Apr-10 6:03
mvePIEBALDconsult9-Apr-10 6:03 
GeneralRe: please i need the complation of 4 queen Pin
amrreko9-Apr-10 7:50
amrreko9-Apr-10 7:50 
AnswerRe: please i need the complation of 4 queen Pin
Chris Losinger9-Apr-10 6:31
professionalChris Losinger9-Apr-10 6:31 
AnswerRe: please i need the complation of 4 queen Pin
leckey9-Apr-10 7:09
leckey9-Apr-10 7:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.