From 66b40121c6b43f882dad8e30fd76f9c935ab7818 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Fri, 22 Aug 2025 13:44:37 +0200 Subject: [PATCH] DocumentViewer visible Viewer --- Controls.DocumentViewer/DocumentViewer.vb | 8 ++++++++ Controls.DocumentViewer/My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Controls.DocumentViewer/DocumentViewer.vb b/Controls.DocumentViewer/DocumentViewer.vb index 7a8fc141..fd710e27 100644 --- a/Controls.DocumentViewer/DocumentViewer.vb +++ b/Controls.DocumentViewer/DocumentViewer.vb @@ -473,6 +473,7 @@ Public Class DocumentViewer SpreadsheetControl1.Visible = False RichEditControl1.Visible = False + SpreadsheetControl1.Dock = DockStyle.None RichEditControl1.Dock = DockStyle.None @@ -485,11 +486,13 @@ Public Class DocumentViewer oRange.AutoFitColumns() SpreadsheetControl1.Visible = True + GdViewer.Visible = False SpreadsheetControl1.Dock = DockStyle.Fill Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT" RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension)) RichEditControl1.Visible = True + GdViewer.Visible = False RichEditControl1.Dock = DockStyle.Fill Case Else GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer @@ -499,9 +502,14 @@ Public Class DocumentViewer GdViewer.BackColor = Color.White If GdViewer.DisplayFromFile(FilePath) <> GdPictureStatus.OK Then + Dim oFileName = IO.Path.GetFileName(FilePath) lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName) lbFileNotLoaded.Visible = True + Else + If GdViewer.Visible = False Then + GdViewer.Visible = True + End If End If End Select diff --git a/Controls.DocumentViewer/My Project/AssemblyInfo.vb b/Controls.DocumentViewer/My Project/AssemblyInfo.vb index f1fdc4e4..45376bce 100644 --- a/Controls.DocumentViewer/My Project/AssemblyInfo.vb +++ b/Controls.DocumentViewer/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +