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

  • SEARCH
  • Home
  • 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 6327763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:20:15+00:00 2026-05-24T17:20:15+00:00

I have made a draw method in a separate class to that of the

  • 0

I have made a draw method in a separate class to that of the form.

public class Object : Form1
 {   
    public void Draw()
    {
            SolidBrush brush = new SolidBrush(Color.Yellow);
            Graphics mapGraphics = this.CreateGraphics();
            mapGraphics.FillEllipse(brush, new Rectangle(0, 0, 12, 12));
            pacBrush.Dispose();
            mapGraphics.Dispose();
    }
}

There are no exceptions thrown, nor errors. I have tried to call the Draw method from the Form_Paint method, but nothing happens at all. How can I fix this?

Thanks

  • 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-24T17:20:16+00:00Added an answer on May 24, 2026 at 5:20 pm

    To draw into a window, you need to use the Graphics object for that window. Your method creates a new Graphics object, so it draws “somewhere else”.

    Pass the e.Graphics object that you have in your Form_Paint handler into the method as a parameter, and draw using that instead.

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

Sidebar

Related Questions

I have made a debugger for the websites i develop that i simply include
I have made a simple table form here in jsfiddle . I also put
I have made a background that needs to cover the whole page. I know
I have made a program with vb.net and I want that program to run
I have an app that uses cgcontext to draw things onto a UIImageView that
I made this application that lets the user draw a line on the screen
I have a custom box that I've made that is a subclass of NSBox
Edit 4: A new formatting for the question BACKGROUND: I have a class, Window,
I have a library that draw on to given HDC using GDI+ apis. I
I have made a simple html page with an image on it to display

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.