양식을 다음 창으로 이동하는 방법을 알고 있습니까? 아니면 현재 모니터가 마지막 것일 경우 순환 시키십시오.) 최대화 할 수 있습니까? 나는 놀고 있었고, "보통"windowstate에있는 경우 폼을 움직이는 코드 (스스로 가르쳐 주셨으므로 친절하시기 바랍니다)를 작성했지만 최대화 부분에 붙어 있습니다. 나는 WindowState = Maximized가 그것을 할 것이라고 생각했을 것이다. 그러나 폼에 설정하면 move 함수가 응답하지 않는다.VB.NET - 양식을 다음 모니터로 이동하여 최대화
Module Monitor
Public totalMonitors As Integer = System.Windows.Forms.Screen.AllScreens.Count
Private xPositionForMonitors As New Dictionary(Of Integer, Integer)
Private yPositionForMonitors As New Dictionary(Of Integer, Integer)
Private currentMonitorIndex As Integer
Private newMonitorIndex As Integer
Public Sub buildMonitorArray()
For m As Integer = 0 To (totalMonitors - 1)
xPositionForMonitors.Add(m, System.Windows.Forms.Screen.AllScreens(m).WorkingArea.Location.X)
yPositionForMonitors.Add(m, System.Windows.Forms.Screen.AllScreens(m).WorkingArea.Location.Y)
Next
End Sub
Public Sub moveToNextMonitor(targWindow As Form)
identifyCurrentMonitor(targWindow)
targWindow.SetDesktopLocation(xPositionForMonitors(newMonitorIndex) + 1, 0)
End Sub
Private Sub identifyCurrentMonitor(targWindow As Form)
For c As Integer = 0 To (totalMonitors - 1)
If targWindow.Location.X + 10 > xPositionForMonitors(c) Then
currentMonitorIndex = c
End If
Next
newMonitorIndex = currentMonitorIndex + 1
If newMonitorIndex = totalMonitors Then newMonitorIndex = 0
End Sub
End Module
는 현재, 내가 양식에 moveToNextMonitor (나)를 사용하여 다음 폼로드시 buildMonitorArray 함수를 호출하고있어 : 아래
내가 지금까지 가지고있는 코드입니다.
당신은 moveToNextMonitor 후 FormWindowState.Maximized에 WINDOWSTATE을 설정 했습니까? – Steve
Windows 7/8에서는 Windows 키 + Shift 키 + 오른쪽 화살표를 사용하여 오른쪽 모니터로 이동하고 Windows 키 + 위쪽 화살표를 사용하면 최대화 할 수 있습니다. –