Show All Forms In A Project with C#

This will list all forms or other types you specify that are in your particular Visual Studio project. It is a continuation of redoing code I have previously done in for C#. It can come in handy when documenting your code during your project. If it’s a form, do a certain set of actions, a class then do another set of actions and so on.

You can find the version here. There were some changes made from that version.

Have a great day!

           System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetEntryAssembly();
           Type[] Types = myAssembly.GetTypes();
           foreach (Type myType in Types)
               if (myType.BaseType == null) continue;

               if (myType.BaseType.FullName == “System.Windows.Forms.Form”) MessageBox.Show(myType.Name);

               //else { MessageBox.Show(myType.Name); }      


, , , , , , , , , , , , , , , , , , , ,

  1. #1 by despasito on September 14, 2018 - 2:03 am

    Thank you so much. it is really helpfull.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: