Home

Get the screen resolution (size)- VB.NET

Visual Basic 2008 / 2010 / 2012 / 2013

The following example shows you how to get the screen resolution in visual basic .net
Get the screen resolution- vb.net
The code to use to get the resolution is pretty easy:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = Screen.PrimaryScreen.WorkingArea.Width
        TextBox2.Text = Screen.PrimaryScreen.WorkingArea.Height
End Sub


That's it. Your screen width will show in TextBox1 and the height will show in TextBox2

Home