how to add namespace to vbnet page

I am trying to get screen width with something like   Width = Screen.PrimaryScreen.Bounds.Width.
I understand I need to add the System.Windows.Forms namespace.  I have tried to add the namespace reference but says it is an invalid reference.
What is the correct reference? Here is what i am currently importing:
Imports System.Data
Imports System.Data.OleDb


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lokesh B RDeveloperCommented:

1. Right-Click on the References in your Project.

2. Click Add Reference

3. Select the System.Windows.Forms

4. Click Ok

In Page

Dim Width As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width

Open in new window


Imports System.Windows.Forms
You are working on a website (I assumed that by looking at the zones of the question) so leave the winforms namespaces alone. That will give you resolution of the webserver.

If you need to get CLIENT resolution in server side code, check following URL

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
williecgAuthor Commented:
thanks, works great
williecgAuthor Commented:
thanks, works great
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.