Show Form on a Second Screen - Dual Monitor - - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

The purpose of this tutorial is to show you how you can display a form in visual basic on a second screen (Dual Monitor). It can be used in an advertising environment where you want to display an Ad on a second screen while the main screen can be used for other things.

Show Form on Second Screen - Visual Basic .Net

For this tutorial you need to have two forms. Form1 and Form2.

Add a button and place it on Form1

When Button1 is clicked, Form2 will be displayed on the external screen. Here is the code for Button1 click event:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
	Dim screen As Screen
	'Show the form on second screen
	screen = screen.AllScreens(1)
	Form2.StartPosition = FormStartPosition.Manual
	Form2.Location = screen.Bounds.Location + New Point(100, 100)
	Form2.Show()
End Sub

You can put any content on Form2 such as a picture box that will display an Ad.


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2015 - All Rights Reserved.