Avatar of williecg
williecg
Flag 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
ASP.NET.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
williecg

8/22/2022 - Mon
Lokesh B R

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
Nasir Razzaq

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
williecg

ASKER
thanks, works great
williecg

ASKER
thanks, works great
Your help has saved me hundreds of hours of internet surfing.
fblack61