In my code I have a main form (named frmMain) and an About Box(named AboutBox1). What I want to happen is when the user clicks on the Help menu in my menu strip and then clicks on About I want the AboutBox1 form to show. I've researched on how to do it but the intellisense is not recognizing the second form when I try and type and I have no idea why. Any ideas?
The code that I'd assume that I put in my menu button click even is:
AboutBox1 aboutbox = new aboutbox();
aboutbox.ShowDialog();
however AboutBox1 gives an error that the type or namespace could not be found.
Here is the code I currently have. Along with this is also a newly created form that has nothing but the initial code in it:
This line:
Is not a proper initialization of object in C# language. You should try to initialize the object in the following way:
Read more at MSDN:
Try this :
ShowDialog()
creates a modal window, if you need to create a modeless window you can useShow()
method.in C#
the typical way to initialize a object is
Go though this article once :
Objects (C# Programming Guide)
it will help you to understand a few basic things.If your class is named
AboutBox1
you need to useto instantiate the
aboutbox
object of the typeAboutBox1