SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

How do I access System.Windows.Forms?

Last post 07-01-2012 7:21 PM by siegi44. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-01-2012 6:01 AM

    • FizzledOut
    • Not Ranked
    • Joined on 06-30-2012
    • 35th st Sunning Road, Arizona
    • Posts 1

    How do I access System.Windows.Forms?

    I use SharpDevelop with no add-ons, version 4.1.0.8000 on MS Windows 7 upgraded from Vista.  In any empty C-sharp file, the compiler said this.

    Problem

    Is there any support in #Develop for OS-specific code?  The error in the image said that I might be missing an assembly reference...  Am I missing an assembly reference?  Is this an error by SharpDevelop?  Are Gui functions available in C#?  How about #Develop?  What is an assembly?  What is the command line, since I've heard it used for invoking applications, invoking functions, specifying arguments, etc.  What is the 'command line compiler' (in English, please)?  How do I use it?  Please answer as many of these as possible.  Please for the love of God, do not simply give me a list of helpful websites... I was there already.

    As a side note... Is there any Official documentation on C# that isn't inexorably linked to Visual Basic and that can guide me through C# step by step without skipping around?  And as another side-note: What's the difference between Visual Basic C# and normal C#?  How does SharpDevelop's C# compiler differ from Microsoft's Visual Studio compiler?

  • 07-01-2012 7:21 PM In reply to

    • siegi44
    • Top 10 Contributor
    • Joined on 03-31-2006
    • Steyr, Austria
    • Posts 806
    • Team Members

    Re: How do I access System.Windows.Forms?

    Hi,

    I do not want to sound rude, but on one hand you ask tons of questions. On the other  hand you say you have already read through "a list of helpful websites". I do not believe you. Because if you had read through MSDN (or any other "helpful" website) before posting here, all of your questions would already be answered.

    Short answer: Read this and most (if not all of your questions) will be answered. If you still have questions, please consult MSDN. If you then still cannot find an answer, you can post here.

    Long answer:

    FizzledOut:
    In any empty C-sharp file, the compiler said this


    SharpDevelop does not support compiling single files. Please create a project (you can follow this short guide). If you want to compile single files, you would have to use the command line (compiler), but more on that later. Anyway, it is easier to always just create a project.

    FizzledOut:
    Is there any support in #Develop for OS-specific code? 


    Of course. You can use any .NET or COM library and build a program on top of it. But that is not a matter of SharpDevelop. SharpDevelop just invokes the Microsoft C# compiler.

    FizzledOut:
    The error in the image said that I might be missing an assembly reference...  Am I missing an assembly reference?

    Apparently, otherwise the compiler would be fine.

    FizzledOut:
    Is this an error by SharpDevelop? 

    No.

    FizzledOut:
    Are Gui functions available in C#?

    Yes. Please follow the guide mentioned above or read the information written in the wikibook.

    FizzledOut:
    How about #Develop?

    SharpDevelop has support for lots of different applications. It provides a graphical designer for both Windows Forms and Windows Presentation Foundation.

    FizzledOut:
    What is an assembly?

    An assembly is (almost always) stored in a file with the suffix ".exe" or ".dll". It contains your source code compiled into IL code (intermediate language code) if it is a .NET assembly, or normal machine code if it is a native assembly (written in C or C++).

    Assemblies can directly executed by the computer, hence they are called exe(cutables). Or can be used as library (= DLL, Direct Link Library) to share code between multiple programs. If you want to use an assembly in a program you have to create an assembly reference. See the picture below:

    Now a dialog should pop up. There on the "GAC" tab look for "System.Windows.Forms" and "System.Drawing", select it and click "Add" (for both) and click OK.

    FizzledOut:
    What is the command line, since I've heard it used for invoking applications, invoking functions, specifying arguments, etc. 

    The command line, more often called "(black) DOS box", is a program used to execute commands. You can use it to browse the file system, create, view, edit, delete, move and copy files and execute programs. For example del *.txt deletes all txt-files in the current folder.

    For more information see Wikipedia.

    FizzledOut:
    What is the 'command line compiler' (in English, please)?

    The command line compiler is the normal compiler. The differences are in the usage. If it is used as command line compiler it receives the information on what to compile and where to compile to, through command line arguments.

    FizzledOut:
    How do I use it?

    Open up a command line by hitting Windows + R  and then entering cmd followed by <enter>.

    You should  see a black window with something like this written in it:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\Users\<your username>>


    This is the so-called command prompt, you can enter any command.

    To test if everything is set up correctly just type: csc and hit enter again:

    C:\Users\<your username>>csc

    If it works, you should see something like this:

    Microsoft (R) Visual C# Compiler version 4.0.30319.17626
    for Microsoft (R) .NET Framework 4.5
    Copyright (C) Microsoft Corporation. All rights reserved.

    warning CS2008: No source files specified
    error CS1562: Outputs without source must have the /out option specified

    If it does not work, you will see this message:

    'csc' is not recognized as an internal or external command,
    operable program or batch file.

    You can now use csc /out:my.exe my.cs to compile your programs, but it is not recommended, because IDEs like SharpDevelop help you with these things.

    FizzledOut:
    Is there any Official documentation on C# that isn't inexorably linked to Visual Basic and that can guide me through C# step by step without skipping around? 

    See here: C# programming guide

    FizzledOut:
    What's the difference between Visual Basic C# and normal C#?

    You are mixing things up: There's C# and Visual Basic. These are two different languages. Visual C# (that's what you probably meant) is just another (more fancy) name for Microsoft C#. It was probably created to follow the scheme of Visual Basic, Visual C++, Visual FoxPro and so on.

    FizzledOut:
    How does SharpDevelop's C# compiler differ from Microsoft's Visual Studio compiler?

    There is no difference. SharpDevelop directly uses Microsoft's compiler (as already mentioned above).

    Hope this helps. Next time, please use Google and read some of the "helpful" websites, first.

    Thank you,

    regards,

    Siegfried

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.