Link to home
Start Free TrialLog in
Avatar of williecg
williecgFlag for United States of America

asked on

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

thanks,

WCGee
Avatar of Lokesh B R
Lokesh B R
Flag of India image

Hi,

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



OR

Imports System.Windows.Forms
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of williecg

ASKER

thanks, works great
thanks, works great