Author Topic: Launching an application on a second monitor  (Read 4527 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Launching an application on a second monitor
« on: November 12, 2016, 02:38:36 PM »
If you have a multi-monitor setup and want an AdvancedHMI application to always start on the second monitor:

- In design view of the MainForm, double click in a blank area. This will take you back to the FormLoad event handler
- Add this coce:
Code: [Select]
   Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If Screen.AllScreens.Length > 1 Then
            Me.Location = Screen.AllScreens(1).Bounds.Location
        End If
    End Sub

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: Launching an application on a second monitor
« Reply #1 on: May 03, 2017, 04:21:18 PM »
this is a great code

thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Launching an application on a second monitor
« Reply #2 on: May 03, 2017, 04:53:27 PM »
The AdvancedHMI panel PCs have an HDMI output with up to 1920x1080 resolution. This feature was designed into the panel to allow an HMI and large production display to operate from a single unit. The code snippet above enables this.