DocView Anpassungen - Vorbereitung Update .NEt8

This commit is contained in:
Developer01
2025-10-01 15:20:16 +02:00
parent acc5dd4d46
commit 2e57e079b0
13 changed files with 419 additions and 557 deletions

View File

@@ -64,6 +64,7 @@ Partial Class DocumentViewer
Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()
Me.lbFileNotLoaded = New DevExpress.XtraEditors.LabelControl()
Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl()
Me.lblInfo = New System.Windows.Forms.Label()
CType(Me.BarManager1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemTextEdit2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemTextEdit3, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -140,7 +141,7 @@ Partial Class DocumentViewer
Me.GdViewer.ScrollLargeChange = CType(50, Short)
Me.GdViewer.ScrollSmallChange = CType(1, Short)
Me.GdViewer.SilentMode = True
Me.GdViewer.Size = New System.Drawing.Size(1012, 557)
Me.GdViewer.Size = New System.Drawing.Size(841, 522)
Me.GdViewer.TabIndex = 0
Me.GdViewer.TabStop = False
Me.GdViewer.ViewRotation = System.Drawing.RotateFlipType.RotateNoneFlipNone
@@ -354,15 +355,15 @@ Partial Class DocumentViewer
Me.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top
Me.barDockControlTop.Location = New System.Drawing.Point(0, 0)
Me.barDockControlTop.Manager = Me.BarManager1
Me.barDockControlTop.Size = New System.Drawing.Size(1012, 33)
Me.barDockControlTop.Size = New System.Drawing.Size(841, 33)
'
'barDockControlBottom
'
Me.barDockControlBottom.CausesValidation = False
Me.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom
Me.barDockControlBottom.Location = New System.Drawing.Point(0, 590)
Me.barDockControlBottom.Location = New System.Drawing.Point(0, 555)
Me.barDockControlBottom.Manager = Me.BarManager1
Me.barDockControlBottom.Size = New System.Drawing.Size(1012, 0)
Me.barDockControlBottom.Size = New System.Drawing.Size(841, 0)
'
'barDockControlLeft
'
@@ -370,15 +371,15 @@ Partial Class DocumentViewer
Me.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left
Me.barDockControlLeft.Location = New System.Drawing.Point(0, 33)
Me.barDockControlLeft.Manager = Me.BarManager1
Me.barDockControlLeft.Size = New System.Drawing.Size(0, 557)
Me.barDockControlLeft.Size = New System.Drawing.Size(0, 522)
'
'barDockControlRight
'
Me.barDockControlRight.CausesValidation = False
Me.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right
Me.barDockControlRight.Location = New System.Drawing.Point(1012, 33)
Me.barDockControlRight.Location = New System.Drawing.Point(841, 33)
Me.barDockControlRight.Manager = Me.BarManager1
Me.barDockControlRight.Size = New System.Drawing.Size(0, 557)
Me.barDockControlRight.Size = New System.Drawing.Size(0, 522)
'
'BarStaticItem1
'
@@ -422,7 +423,7 @@ Partial Class DocumentViewer
'
'SpreadsheetControl1
'
Me.SpreadsheetControl1.Location = New System.Drawing.Point(147, 190)
Me.SpreadsheetControl1.Location = New System.Drawing.Point(31, 152)
Me.SpreadsheetControl1.MenuManager = Me.BarManager1
Me.SpreadsheetControl1.Name = "SpreadsheetControl1"
Me.SpreadsheetControl1.ReadOnly = True
@@ -445,7 +446,7 @@ Partial Class DocumentViewer
Me.lbFileNotLoaded.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None
Me.lbFileNotLoaded.Location = New System.Drawing.Point(3, 74)
Me.lbFileNotLoaded.Name = "lbFileNotLoaded"
Me.lbFileNotLoaded.Size = New System.Drawing.Size(1006, 72)
Me.lbFileNotLoaded.Size = New System.Drawing.Size(835, 72)
Me.lbFileNotLoaded.TabIndex = 0
Me.lbFileNotLoaded.Tag = ""
Me.lbFileNotLoaded.Text = "Die Datei konnte nicht geladen werden"
@@ -453,17 +454,31 @@ Partial Class DocumentViewer
'
'RichEditControl1
'
Me.RichEditControl1.Location = New System.Drawing.Point(571, 238)
Me.RichEditControl1.Location = New System.Drawing.Point(395, 238)
Me.RichEditControl1.MenuManager = Me.BarManager1
Me.RichEditControl1.Name = "RichEditControl1"
Me.RichEditControl1.Size = New System.Drawing.Size(400, 200)
Me.RichEditControl1.TabIndex = 5
Me.RichEditControl1.Visible = False
'
'lblInfo
'
Me.lblInfo.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lblInfo.AutoSize = True
Me.lblInfo.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblInfo.ForeColor = System.Drawing.Color.Red
Me.lblInfo.Location = New System.Drawing.Point(3, 533)
Me.lblInfo.Name = "lblInfo"
Me.lblInfo.Size = New System.Drawing.Size(47, 15)
Me.lblInfo.TabIndex = 10
Me.lblInfo.Text = "Infotext"
'
'DocumentViewer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.Controls.Add(Me.lblInfo)
Me.Controls.Add(Me.RichEditControl1)
Me.Controls.Add(Me.lbFileNotLoaded)
Me.Controls.Add(Me.SpreadsheetControl1)
@@ -473,7 +488,7 @@ Partial Class DocumentViewer
Me.Controls.Add(Me.barDockControlBottom)
Me.Controls.Add(Me.barDockControlTop)
Me.Name = "DocumentViewer"
Me.Size = New System.Drawing.Size(1012, 590)
Me.Size = New System.Drawing.Size(841, 555)
CType(Me.BarManager1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RepositoryItemTextEdit2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RepositoryItemTextEdit3, System.ComponentModel.ISupportInitialize).EndInit()
@@ -526,4 +541,5 @@ Partial Class DocumentViewer
Friend WithEvents btnSearch As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnSearch2 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents lblInfo As Label
End Class

View File

@@ -123,6 +123,9 @@
<metadata name="BarManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>285, 22</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
<assembly alias="DevExpress.Data.v21.2" name="DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="buttonPrint.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -468,6 +468,7 @@ Public Class DocumentViewer
End Sub
Private Function DoLoadFile(FilePath As String, Optional ViewOverride As String = "") As Boolean
Try
lblInfo.Visible = False
Dim oFileInfo = New FileInfo(FilePath)
Dim oExtension As String = oFileInfo.Extension.ToUpper
@@ -486,8 +487,8 @@ Public Class DocumentViewer
RichEditControl1.Dock = DockStyle.Fill
_ViewOverride = "Richtext"
_ViewerMode = ViewerMode.Richtext
MsgBox("This docx-file contains a generic error and will be displayed in a reduced viewer." & vbNewLine &
"Please try to open the file in WORD", MsgBoxStyle.Exclamation, "Error opening docx-file")
lblInfo.Visible = True
lblInfo.Text = "This docx-file contains a generic error and will be displayed in a reduced viewer. Please try to open the file in WORD"
Else
_ViewOverride = ""
Select Case oExtension.ToUpper