I\'ve tried a huge amount of ways to get a static reference of my window across my program. I need to access all of its members at runtime from different classes, so a stati
Create a static class that can contain the window object, and then when the window is created, have it pass itself to the static class, from then on the static class can hand out the window object to interested parties even though the window object itself is not static. Something like this. There is no need for your form to be static, you just need a static place to hold the form object.
public class Core
{
internal static MyWindowClass m_Wnd = null;
// call this when your non-static form is created
//
public static void SetWnd(MyWindowClass wnd)
{
m_Wnd = wnd;
}
public static MyWindow { get { return m_Wnd; } }
}