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 8848543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:26:49+00:00 2026-06-14T12:26:49+00:00

I know that this a very common topic and I have been searching for

  • 0

I know that this a very common topic and I have been searching for some time for a solution. Again I am working on a CHIP8 emulator and I am trying to create a separate form to process the graphics.

I now have two forms, Form1 and graphics. What I would like to do is call the “draw” method in graphics from Form1. In Form1 I have the following code…

This is the error that I am getting:
Error 4 ‘System.Windows.Forms.Form’ does not contain a definition for ‘Draw’ and no extension method ‘Draw’ accepting a first argument of type ‘System.Windows.Forms.Form’ could be found (are you missing a using directive or an assembly reference?)

Form graphicsTest = new graphics(); // This is in the initial declaration of Form1
graphicsTest.Draw(screen); // Screen is a [64,32] boolean array representing pixel states

Here is what I have for “graphics”…

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class graphics : Form // The purpose of this form is to handle the graphics
{
    Graphics dc;
    Rectangle ee = new Rectangle(10, 10, 30, 30); // Size of each pixel
    Pen WhitePen = new Pen(Color.White, 10); // Pen to draw the rectangle object
    Pen BlackPen = new Pen(Color.Black, 10);
    bool[] drawMe;

    public graphics()
    {
        InitializeComponent();
        dc = this.CreateGraphics();
    }

    private void Form2_Load(object sender, EventArgs e)
    {

    }

    public void Draw(bool[] drawme) // This method recieves the array and draws the appropriate Sprites!
    {
        // This is where I will draw the appropriate pixels...   
    }
}
}

Again, I may be missing something simple, This is all relatively new to me and I apologize if I have not posted enough information. Any input is appreciated!

  • 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-06-14T12:26:50+00:00Added an answer on June 14, 2026 at 12:26 pm

    Change type of variable to graphics instead of Form

    graphics graphicsTest = new graphics(); 
    graphicsTest.Draw(screen);
    

    Otherwise only base class members will be available to you.

    BTW use PascalCase for class names in C#.

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

Sidebar

Related Questions

I know that this is very common problem and I have gone through almost
I know that this is a repeated question. I have found very similar questions
I know that this question must have been asked and answered a million times,
I know that this error is very common, but I tried to apply the
I know that this question is very similar to the question posted here .
I know that this sort of question has been asked here before, but still
I know that this question had already been asked a couple of times before,
I know that this has already been asked here but the answer (using a
I know this is a very common problem. I was trying to get a
I have a scenario that i suspect is very common, i've found various ideas

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.