• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

can't import System.Windows.Forms

I've tried in VS .net Architect and VS 2003, using framework 1.1. anyone know why this would happen??

TIA
0
dprasad
Asked:
dprasad
  • 3
  • 3
1 Solution
 
S-TwilleyCommented:
can you give a little more detail on what you're trying to do... i know the title says one part but what kind of project have you created, and where/how have you tried to import Windows.Forms?
0
 
dprasadAuthor Commented:
im trying to run a very simple bit of code, this:

Imports System.Windows.Forms

Module modSquareRoot

    Sub Main()
        Dim root As Double = Math.Sqrt(2)
        MessageBox.Show("The sq root of 2 is" & root)
    End Sub
End Module
0
 
S-TwilleyCommented:
you need to add a reference to the dll.

goto your solution explorer (top right usually), right click on references, and goto add reference

scroll down to System.Windows.Forms.dll  and double click, and goto OK

then the code should work
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
dprasadAuthor Commented:

cool thanks!
0
 
S-TwilleyCommented:
if its a console application... you could use something like:

    Sub Main()
        Dim root As Double = Math.Sqrt(2)
        Console.WriteLine("The sq root of 2 is" & root)
        Console.ReadLine()
    End Sub

==========

then you won't need to reference the windows form library...

0
 
dprasadAuthor Commented:
ok yeah that works too. i'm trying to get back into .net after a very long time in php world, yuck!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now