Opening 2nd display in vb.net not working as in windows

Questions about Wine on Linux
Post Reply
ibdave
Level 2
Level 2
Posts: 16
Joined: Mon Apr 24, 2023 7:13 pm

Opening 2nd display in vb.net not working as in windows

Post by ibdave »

I wrote a program (and I readily admit very badly coded) program in vb.net that opens a 2nd form on the 2nd monitor only while the main program form remains on the main screen - in this case a laptop. In ubuntu 25.04 with wine the 2nd form opens over the top of the main form and has to be manually dragged to the 2 monitor.

This is in a 32-bit prefix with dotnet 4.5, speech.sdk and vbrun6 installed via winetricks.

The code is in the form load procedure for the main (default) form:

Code: Select all

      If Screen.AllScreens.Length > 1 Then
           Dim screen As Screen
           'Show the form on second screen
           screen = Screen.AllScreens(1)
           _2NDMonitor.Location = Screen.AllScreens(1).Bounds.Location
           _2NDMonitor.StartPosition = FormStartPosition.Manual
           _2NDMonitor.Location = screen.Bounds.Location + New Point(1, 1)
           _2NDMonitor.PictureBox1.Refresh()
           SECOND_MONITOR = True
           _2NDMonitor.Enabled = True
           _2NDMonitor.Visible = False
           _2NDMonitor.Show()
  
After that things are just written to the form on the 2nd screen. If the screen was available then as per the form load the writes to the screen just show there. So while the main laptop screen might be showing "x" the 2nd screen might be showing "y".

I'm using simple usb-c to hdmi adaptor with a casio projector as the 2nd monitor.

Thanks for any help!
ibdave
Level 2
Level 2
Posts: 16
Joined: Mon Apr 24, 2023 7:13 pm

Re: Opening 2nd display in vb.net not working as in windows

Post by ibdave »

Dumb question: is it possible that at the system level windows is returning a relative one result and linux returning a relative zero result?
Post Reply