Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3807596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:01:01+00:00 2026-05-19T15:01:01+00:00

This is my code. When I move cursor over Form it works, circle is

  • 0

This is my code. When I move cursor over Form it works, circle is moving but it is blinking. How can I fix this?

public partial class Preprocesor : Form
{
    int x, y;
    Graphics g;

    public Preprocesor()
    {
        InitializeComponent();
    }

    private void Preprocesor_Load(object sender, EventArgs e)
    {
        g = pnlMesh.CreateGraphics();
    }

    private void pnlMesh_Paint(object sender, PaintEventArgs e)
    {
        g.Clear(Color.White);
        g.FillEllipse(Brushes.Black, x, y, 10, 10);
    }

    private void pnlMesh_MouseMove(object sender, MouseEventArgs e)
    {
        x = e.X;
        y = e.Y;
        pnlMesh.Invalidate();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:01:02+00:00Added an answer on May 19, 2026 at 3:01 pm

    You need to draw on a double-buffered control.

    Make a class that inherits Control and sets DoubleBuffered = true; in the constructor (this is a protected property).
    Use that control instead of your panel it there won’t be any flickering.

    Also, you should not store a Graphics object for later.
    Instead, you should draw on e.Graphics in the Paint handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've used this code in another site I've made and it works absolutely fine
my class extends Activity, not ListActivity. i have this code on create method but
I want to move nodes in nokogiri to a parent. I have this: <root>
I have an unordered list with each list item background changing color when the
I have reduced a complex schema to the following samples Students StudentID int, Name
I'm using the JQuery Draggable plugin . I'm trying to create an Image Editing
I'm writing RESTful service with C#/wcf and need to put filters on GET. Like
I have a simple link: <a href=# id=test>Test Link</a> I want to get an
I have an error trying to use $(document).ready() as in the above image. What
I have a slightly nasty setup which I am trying to figure out a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.