Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Windows Forms is not a namespace here, it is a technology to develop apps for Windows.
There is .Net Framework Class Library,
but as i understand Windows Forms does not access to all of them,
it accesses only a part of them. Right?

I can find Windows Forms API list in my Visual Studio by clicking:
Solution/Project/References/Add Reference.../.Net

But i am curious is there another place to find API list, for example, on msdn website?
Posted
Updated 6-Jan-15 7:16am
Comments
Leo Chapiro 5-Jan-15 10:56am    
Take a look: http://msdn.microsoft.com/en-us/library/system.windows.forms%28v=vs.110%29.aspx
Sergey Alexandrovich Kryukov 5-Jan-15 11:25am    
Why, and what it would probably be? List of what (types? methods? public members? generic types?)?
What to do with types which are not defined in System.Windows.Forms.* but are typically used with Forms programming? Than it would be a fuzzy criteria.
—SA
Ziya1995 5-Jan-15 12:34pm    
No, i am talking about Windows Forms technology like WPF.
I am not talking about Windows.Forms namespace.
Their names are just accidently same.

I need a list of classes, functions, methods and so on, in other words what Windows Forms uses from .Net Framework, for example, from 4.0 version.
Sergey Alexandrovich Kryukov 5-Jan-15 12:37pm    
What is "Windows Forms technology like WPF"? No, the namespace name are not "accidentally the same".
Anyway, the problem is related to assemblies; and namespaces are pretty much irrelevant. In my Solution 2, I gave you the clear idea which you can apply to any set of assemblies.
—SA
Ziya1995 5-Jan-15 12:42pm    
You are talking about namespace or technology?
> What is "Windows Forms technology like WPF"?
I am not talking about namespace.
Windows Forms rivals WPF.
http://msdn.microsoft.com/en-us/library/dd30h2yb(v=vs.100).aspx

System.Windows.Forms[^] is a good place to start!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Jan-15 11:31am    
5ed, but you did not list some other approach and did not concern about the vagueness of this question.
Please see my comment to the question and Solution 2.
—SA
Ziya1995 5-Jan-15 12:37pm    
I started 2 years ago, thank you, i don't need that.
I appreciate your diligence, guys, but you can take a bit to understand my simple question.

I need a list of classes, methods, functions and so on, a part of API that Windows Forms uses.
I need a list of what Windows Forms uses.
Windows Forms uses a part of the whole .Net Framework, i need a list of that part.
Sergey Alexandrovich Kryukov 5-Jan-15 12:42pm    
Please see my other comment and finally agree that the problem is different: you are the one who don't really understand what you want, not us. I tried to explain it, but maybe you did not get it yet.
—SA
Ziya1995 5-Jan-15 12:50pm    
No, i can't understand.
Listen, i use Windows Forms to code.
I need a list of what it uses by default from .Net Framework.

What is wrong? Please explain me, what is wrong? Thanks.
Look:
http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx
I am talking about Windows Forms technology, not namespace.
Sergey Alexandrovich Kryukov 5-Jan-15 14:31pm    
There is no "by default". However, if you mean defaults created by Visual Studio (there is nothing fundamental in such "default" references, this is just how VS creators understood convenience of a typical developer; in fact, some of these assemblies would be redundant), take a fresh Forms project (from default template) and list all references used in it. Mind you, it won't be a list of what is actually used. If you also compile the project, reflection can tell you what's loaded.
—SA
Windows Forms is a high-level meta-construct that uses the .NET FrameWork; it creates a level of abstraction above the lower-level API calls that it uses: it hides the lower-level usage from casual view. Of course, Windows Forms does not use everything in the FrameWork !

Windows Forms incorporates its own graphics engine, GDI+; a different choice than WPF which uses a vector-based graphics engine.

Windows Forms is organized into various functional Libraries which are made available through referencing dll's, and made "visible" through Using statements.

Windows Forms implements an Application Model with a default of instantiating and showing a single main window (Form) which is invoked in a single-threaded-apartment (STA) ApplicationContext in a static 'Main method in a static class 'Program.

In common use, closing this "Main Form" terminates the Application.

I suggest you think carefully about your use of the word "API:" in the broadest sense it can the entire gamut of what a programming environment offers you directly and indirectly, but, if you say it's "everything," what value is there in the word ?

What Windows Forms offers directly, through its predefined syntax for NameSpaces, Forms, UserControls, File Operations, Linq, Classes, Structs, Properties, Methods, Fields, Collections, Generic Collections, etc. is an API, yes, but most often that term has been used to describe a more limited sub-set that requires special methods to use, as in what are often referred to as PInvoke, and low-level system calls, such as WndProc, etc.
 
Share this answer
 
Comments
Ziya1995 5-Jan-15 12:23pm    
I am talking about Windows Forms technology like WPF, not Windows.Forms namespace.
My question is much more simpler, very very simpler, i know all of that, i don't need you to teach me what is Windows Forms and so on, because i already know that.
I am not talking about Platform Invoke, i mean those classes, functions, methods and so on, by simple words what Windows Forms use, not by Platform Invoke, not 3d party components, what does it use from .Net Framework, for example 4.0 version.

I just need to get a list of methods, functions and so on used in C# Windows Forms.
I repeat, i need a list of part of the whole API used in C# Windows Forms.
I repeat, as you said Windows Forms does not use everything in the Framework, i need to get a list of those that it uses.

I have no idea how to explain my simple question, but it is a learning curve.
Thank you!
Sergey Alexandrovich Kryukov 5-Jan-15 12:40pm    
Excuse me, but you are talking gibberish. The set of API types involved in Windows Forms programming is not defined by any certain criteria. See also my comments to the question and to your comments to my answer.
—SA
Ziya1995 5-Jan-15 12:47pm    
Wait, i can get information about any library in .Net Framework Class Library without loading assembly.
But i need a list of libraries used in Windows Forms.

So, there is no such a list, right?
Dave Kreskowiak 6-Jan-15 12:31pm    
No, there is no such list, whatever you're referring to.

The quality of the answers you get is directly dictated by the quality of the question you ask. Since you're misusing terminology, you're making it very difficult to understand what you're talking about.
BillWoodruff 5-Jan-15 13:48pm    
WPF is not Windows Forms; they are two separate "technology stacks" both of which are built on top of the .NET FrameWork. A Form in Windows Forms is a type of Window, but a "Window" in WPF is a different animal; certainly it shares some Properties with a Form, but it is fundamentally different in the vocabulary of behavior it offers for use.

Your questions are not simple because your confusion is not simple. There are hundreds of objects, methods, properties, etc., in Windows Forms, defined in a many different possible Libraries you can choose from.

The System.Windows.Forms dll is not "about" NameSpace; it is a compiled set of methods, structures, properties, definitions of Objects, etc.

The facilities, methods, Objects, defined in that dll are made available by setting a Reference to it (done automatically for you when you create a new Windows Forms Project in Visual Studio) and activating those facilities by a 'using statement. Since the Library has an effective scope, there is nothing wrong about also referring to a the System.Windows.Forms NameSpace !

I think you are "over-thinking" here, imagining there's some master-list of everything which, if you find it, you'll understand everything. In a sense there is:

Open up the System.Windows.Forms dll:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Windows.Forms.dll
With a tool like: ILSpy (free) at http://www.ilspy.net/

And what you find is a "tree" containing everything in that Library. And, that's only one of many Libraries you can use ... it happens to be one of the essential ones, if you wish to create a WinForms Application.

Listen, I have had the lucky experience of teaching many people how to program in WinForms C#, men, women, young adults, teenagers, from different cultures (primarily Asian): confusion is part of the course, and there's nothing wrong with being confused ... initially, and for a while.

You need to get a good book, like, for example, a book by Jesse Liberty or Matthew MacDonald on WinForms, and just put in some time reading, and re-reading, their explanatory chapters.

Technical learning, for most people, is a process of repetitive study of the same materials, and it is catalyzed by constant practice at solving tangible problems suitable to your current skill level, and problems which challenge you to take steps beyond your current skill levels.

You can do this. But, you need to recognize, and I have observed your behavior here for some time, that you are spending far too much time making noise about how you are confused, and getting attention for it.

That's an addiction you need to get over to realize your potential. We all bring to the challenge of learning certain dysfunctional patterns that served us well at some point in our lives, and we all face the challenge of humbly accepting those patterns and trying, slowly, to modify them.

cheers, Bill
Ziya1995 wrote:

Guys, I really ask a simple question, you get my question as something hard, but it is not, look:
I open new Windows Forms project in Visual Studio, then I add references like System.Drawing and so on.
But how can I know how to add a reference, if I don't know names of references.
I repeat, I use namespaces, add references and so on, and now I wanna add a reference to use it, how to add if I don't know a name of reference???
Until today I go to .NET Framework Class Library and copy reference names, but Windows Forms provides access only to a part of the whole Framework and it is not only about System.Windows.Forms namespace, it is also about, for examples, next ones:
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

And now I am a simple guy, I must know names of references, to write them and add, that is one the easiest questions.

I read what you write and understand you are really smart and wise people, but the problem that you are so professional that don't understand my simple question, because you get it as something very hard.
Only now you are getting a bit closer to your question. Before, you never mentioned that you there is problem because you "don't know a name of reference". You said that you were "curious".

First thing to understand is: you listed some using declarations with some namespace. But namespaces are not references. References are assemblies. I don't want to add redundant explanation on what namespaces are, but want to point out: the assembly names are close to the namespaces, but this is done only for convenience. Technically, those names are totally unrelated. Also, there are no any predefined correspondence between those names. In particular, it means:
  • Any assembly can define types using different namespaces, those different namespace don't have to be related.
  • Two different assemblies can define types using the same exact namespace. This approach is actually used in .NET FCL. For example, the namespace "System" is used for defining types by two assemblies: "System" and "System.Core".
  • The assembly name (this is a big separate topic: strong names can be used or not, the names of the main executable module can be used for referencing) does not have to match to any namespace. For example, as far as I know, .NET FCL doesn't declare namespace "System.Core".
  • In rare cases, you can even get fully identical full type names which come from different libraries. There is a little-known feature for the resolution, extern alias. Our inquirers sometimes faces such cases; I helped to resolve such situation, maybe just couple of times.

Now, let's create a brand-new Forms project in Visual Studio, from a standard template and look at the references:
System, System.Core, System.Data, System.Data.SetExtensions, System.Deployment, System.Drawing, System.Forms, System.Xml and System.Xml.Ling. Do one really needs these references (all from the GAC, by strong names)? No! For forms programming, you only need: System, System.Drawing and System.Forms. That's all!

So, what to do? If I create a real thoroughly developed project, I actually remove all the references except those three, but I also leave System.Core (which is not formally needed for Forms programming), and, depending on my expectation and knowledge of future development of the project, leave System.Xml, often also System.Xml.Linq. Everything else is totally redundant and can only confuse. It may make the project fail to compile, but I also remove a number of auto-generated files and auto-generated code. And Visual Studio have very convenient feature, remove unused "using". I add all other references at the moment I really need them and only if I need them. I don't want to insist on my style of developing projects, but I insist that the thoroughly developed project should not have any redundancies of this sort; it is helpful for future developers who support the project to see what is actually involved. That's why I would recommend my course of action.

By the way, why Microsoft creates so redundant project templates? I'm sure, support of the thorough developed project is by far not the first priority. First priority is to have as many developers as possible, and that it done to increase the probability of having it all "up and running". For experienced developers this redundancy is not a problem.

Now, how to know what other assemblies to add to the project? The short answer is: there is no a way, by a very apparent reason: only the developer knows what to add. There is nothing wrong with that. First of all, you do have a list of possible references, if we only considered the assemblies from GAC. When you add such references, we use the tab ".NET" of the "Add Reference" window. Which one to add? There is no a predefined recipe. You have to gradually learn what .NET FCL can help you with and know what you really need and what not. Note that there are other kinds of references: 3rd-party and your own. Both kinds can be strongly-named or not (they should better be), put in GAC or not (should be put in rare cases and responsibly). For your own assemblies you reference, the best way is to put them all in the same solution and reference by projects (the tab "Projects" of the "Add Reference" window).

See also:
http://en.wikipedia.org/wiki/Framework_Class_Library[^],
http://en.wikipedia.org/wiki/Global_Assembly_Cache[^],
http://en.wikipedia.org/wiki/Strong_key[^].

—SA
 
Share this answer
 
v2
Comments
BillWoodruff 6-Jan-15 13:27pm    
+5 Very thoughtful response !
Sergey Alexandrovich Kryukov 6-Jan-15 16:29pm    
Thank you, Bill.
—SA
Ziya1995 6-Jan-15 16:02pm    
I was thinking the whole day and got everything before i opened this page again and saw this post, thank you.
I thought i get access only to a part of the Framework, but not, i can use all of the namespaces, thank you, reference names and namespace names are different, i got it.
I just need to open .Net Framework Class Library, i always was ok with that, but a few days ago i got confused, started thinking wrong, but now everything is ok.
Sorry, i feel a shame, thanks!
Sergey Alexandrovich Kryukov 6-Jan-15 16:31pm    
Please, no need to feel shame and be sorry. Everything is all right, and some confusions happen.
I'm very glad that we came to some positive conclusions.
Good luck, call again.
—SA
Please see my comment to the question: it's not clear what to include (and why).
I can suggest an ultimately reliable method: you can load the assembly "System.Windows.Forms.dll" of required version (from GAC, using strong name) and list whatever you need using reflection.
You can start with:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.load%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes%28v=vs.110%29.aspx[^].

For some background:
http://en.wikipedia.org/wiki/Global_Assembly_Cache[^],
http://en.wikipedia.org/wiki/Strong_key[^].

—SA
 
Share this answer
 
Comments
Manas Bhardwaj 5-Jan-15 11:32am    
Yes +5!
Sergey Alexandrovich Kryukov 5-Jan-15 12:09pm    
Thank you, Manas.
—SA
Ziya1995 5-Jan-15 13:39pm    
No, "System.Windows.Forms.dll" is about namespace, it is about windows interface elements, controls, button, picturebox and so on.

But i am talking about Windows Forms technology.
Look:
http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx
"Windows Forms is a smart client technology for the .NET Framework"

If you want, you can understand that what you talk about and what i talk about are different things.
Sergey Alexandrovich Kryukov 5-Jan-15 14:34pm    
Wrong. "System.Windows.Forms.dll" has nothing to do with namespaces. I think that now I know what you are missing: how assemblies work. As this is one of the central notions of .NET, you should better assume that you have no clue about .NET yet, and learn (probably just a little) to get it.
Namespaces is something created to reduce name conflicts for top-level type names, nothing else.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900