There's one thing that is stopping me from solving this and that I can't figure out. How do I access the form controls and the form events from an outside class. Here is how my code looks:
There are three classes below. That is 2 more than I can handle in this situation

Help would be great
//main code
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form = new Form1();
Application.Run(form);
}
//form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
...//bunch of code using controls
}
}
//other class
using System;
using System.Collections.Generic;
using System.Text;
namespace WindowsApplication1
{
class MainCode
{
IPC ipc;
Form1 form;
Table table;
public Dictionary<string, Table> d = new Dictionary<string, Table>();
public MainCode(Form1 host) // initializer typ
{
form = host;
ipc = new IPC(host);
ipc.OnMessage += new IPC.MessageAction(ipc_OnMessage);
}
}
}
I want to be able to use the form's events and controls in MainCode.
Thankful for help!