Accessing a class in a console application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John McMahon

    #1

    Accessing a class in a console application

    I am a casual programmer learning the C# language.
    I have been going thru the examples in a book on the language.
    This particular example, which is a console application, calls for a using
    statement including the System.Windows. Forms class.
    Although I know the class is there since I have seen it automatically
    generated for a Windows forms application, it somehow is not picked up by
    the Console application.
    There is probably a simple solution for this and I would appreciate it if
    someone would relay it to me.


  • 100

    #2
    Re: Accessing a class in a console application

    Hi John,
    I'm not quite sure what your problem is, but when you compile that console
    application did you specify the System.Windows. Forms.dll assembly as a
    referenced assembly to the compiler. I don't know how you compile your
    programs. Do you use VS .NET or you use command-line compiler?

    Reading your post I am taking you use VS.NET; right click on references node
    for the project in the *solution explorer* utility, select *Add
    reference...* from the menu and then add System.Windows. Forms.dll from the
    list.

    HTH
    B\rgds
    100

    "John McMahon" <macman81@world net.att.net> wrote in message
    news:egdg7sJpDH A.3844@tk2msftn gp13.phx.gbl...[color=blue]
    > I am a casual programmer learning the C# language.
    > I have been going thru the examples in a book on the language.
    > This particular example, which is a console application, calls for a using
    > statement including the System.Windows. Forms class.
    > Although I know the class is there since I have seen it automatically
    > generated for a Windows forms application, it somehow is not picked up by
    > the Console application.
    > There is probably a simple solution for this and I would appreciate it if
    > someone would relay it to me.
    >
    >[/color]


    Comment

    Working...