Public Class frmDocView Private Sub frmDocView_Load(sender As Object, e As EventArgs) Handles Me.Load Try 'Sind Werte hinterlegt? If My.Settings.frmDocViewPosition.IsEmpty = False Then If My.Settings.frmDocViewPosition.X > 0 And My.Settings.frmDocViewPosition.Y > 0 Then ' Gespeicherte Werte verwenden Me.Location = Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location + My.Settings.frmDocViewPosition End If End If 'Sind Werte hinterlegt? If Not My.Settings.frmDocViewSize.IsEmpty Then ' Gespeicherte Werte verwenden Try Me.Size = My.Settings.frmDocViewSize Catch ex As Exception End Try End If Catch ex As Exception LOGGER.Error(ex) LOGGER.Info("Error in Load FormLayout: " & ex.Message) End Try Try DocumentViewer1.Init(LOGCONFIG, GDPICTURE_LICENSE) Catch ex As Exception LOGGER.Warn("Error initializing DocViewer: " & ex.Message) End Try End Sub Private Sub frmDocView_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing My.Settings.frmDocViewSize = Me.Size My.Settings.frmDocViewPosition = Me.Location My.Settings.Save() DocumentViewer1.Done() End Sub Public Sub LoadFile(FilePath As String) DocumentViewer1.LoadFile(FilePath) Timer1.Start() Me.BringToFront() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Me.BringToFront() Timer1.Stop() End Sub End Class