title: How to access form elements from another class
body: <p>I have following code </p>
  
  <pre><code>   namespace Spaceship_Invaders
      {
          public partial class Form1 : Form
          {
              public Form1()
              {
                  InitializeComponent();
                  Image myImage = Image.FromFile("image/Untitled.png");
                  pictureBox1.Image = myImage;
              }
  
              public class spaceship { 
                  Image myimage = Image.FromFile("image/Untitled6.png");
                  Form1 myform = new Form1();
                   myform.pictureBox1.Image = myimage;            
  
  
              }
  
          }
      }
  </code></pre>
  
  <p>I have a picturebox in the form and I want to access the picturebox from the class spaceship but i can not access it. How to do this?</p>