So, I'm struggling a little bit here. I am writing a windows console application in C# and have just made a login form for the application called frmLogin.
I tried using the MS documented method of;
Form f = new Form();
f.ShowDialog();
but this obviously loads/displays a blank form and not the form I defined in the form designer.
In my main application, I want to be able to show the login form programmatically, but when I try to use;
frmLogin.ShowDialog();
it tells me that "An object reference is required for the non-static field, method or property 'System.Windows.Forms.Form.ShowDialog()'
In the old days, I could show a form by simply using the above snippet of code. So, obviously something has changed since the last time I wrote a windows console app.
Can someone show me the error of my ways?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…