From 0d5bfef93f7c66b4c42ff6926f526023fd9970f9 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Thu, 10 Apr 2025 18:01:00 +0200 Subject: [PATCH] MS SnapPanel ScrollBar --- .../DocumentViewer.Designer.vb | 1 + Controls.SnapPanel/My Project/AssemblyInfo.vb | 14 +- Controls.SnapPanel/SnapPanel.vb | 23 ++- GUIs.Test.ZUGFeRDTest/App.config | 116 +++++++++----- GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj | 142 +++++++++++++++++- GUIs.Test.ZUGFeRDTest/packages.config | 30 +++- 6 files changed, 274 insertions(+), 52 deletions(-) diff --git a/Controls.DocumentViewer/DocumentViewer.Designer.vb b/Controls.DocumentViewer/DocumentViewer.Designer.vb index 957b11a0..1dc5f0a9 100644 --- a/Controls.DocumentViewer/DocumentViewer.Designer.vb +++ b/Controls.DocumentViewer/DocumentViewer.Designer.vb @@ -98,6 +98,7 @@ Partial Class DocumentViewer Me.GdViewer.DrawPageBorders = True Me.GdViewer.EnableDeferredPainting = True Me.GdViewer.EnabledProgressBar = True + Me.GdViewer.EnableFuzzySearch = False Me.GdViewer.EnableICM = False Me.GdViewer.EnableMenu = True Me.GdViewer.EnableMouseWheel = True diff --git a/Controls.SnapPanel/My Project/AssemblyInfo.vb b/Controls.SnapPanel/My Project/AssemblyInfo.vb index 0b10867b..becaa04b 100644 --- a/Controls.SnapPanel/My Project/AssemblyInfo.vb +++ b/Controls.SnapPanel/My Project/AssemblyInfo.vb @@ -8,11 +8,11 @@ Imports System.Runtime.InteropServices ' Werte der Assemblyattribute überprüfen - - - - - + + + + + @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' indem Sie "*" wie unten gezeigt eingeben: ' - - + + diff --git a/Controls.SnapPanel/SnapPanel.vb b/Controls.SnapPanel/SnapPanel.vb index 4970d7bc..9225b058 100644 --- a/Controls.SnapPanel/SnapPanel.vb +++ b/Controls.SnapPanel/SnapPanel.vb @@ -5,7 +5,9 @@ Public Class ClassSnapPanel Private _ShowGrid As Boolean = True Private _GridSize As Integer = 16 - + Public Sub New() + Me.AutoScroll = True ' Scrollbars aktivieren + End Sub Public Property GridSize As Integer Get Return _GridSize @@ -30,12 +32,14 @@ Public Class ClassSnapPanel AddHandler e.Control.LocationChanged, AddressOf AlignToGrid AddHandler e.Control.DragDrop, AddressOf AlignToGrid MyBase.OnControlAdded(e) + UpdateScrollArea() End Sub Protected Overrides Sub OnControlRemoved(e As ControlEventArgs) RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid RemoveHandler e.Control.DragDrop, AddressOf AlignToGrid MyBase.OnControlRemoved(e) + UpdateScrollArea() End Sub Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) @@ -51,6 +55,23 @@ Public Class ClassSnapPanel Dim x As Integer = Math.Round(item.Left / _GridSize) * _GridSize Dim y As Integer = Math.Round(item.Top / _GridSize) * _GridSize item.Location = New Point(x, y) + UpdateScrollArea() End If End Sub + Private Sub UpdateScrollArea() + Dim maxWidth As Integer = 0 + Dim maxHeight As Integer = 0 + + ' Größte X- und Y-Koordinate der enthaltenen Controls bestimmen + For Each ctrl As Control In Controls + Dim right As Integer = ctrl.Right + Dim bottom As Integer = ctrl.Bottom + + If right > maxWidth Then maxWidth = right + If bottom > maxHeight Then maxHeight = bottom + Next + + ' Scrollbereich setzen + Me.AutoScrollMinSize = New Size(maxWidth, maxHeight) + End Sub End Class diff --git a/GUIs.Test.ZUGFeRDTest/App.config b/GUIs.Test.ZUGFeRDTest/App.config index 3cf037e4..b4e9b51e 100644 --- a/GUIs.Test.ZUGFeRDTest/App.config +++ b/GUIs.Test.ZUGFeRDTest/App.config @@ -1,15 +1,15 @@ - + -
+
-
+
- + @@ -40,72 +40,112 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj index c7ffabcc..3fab8c34 100644 --- a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj +++ b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj @@ -50,6 +50,9 @@ On + + ..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll + ..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll @@ -67,14 +70,111 @@ ..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll - - ..\packages\GdPicture.14.2.90\lib\net462\GdPicture.NET.14.dll + + ..\packages\DocumentFormat.OpenXml.3.2.0\lib\net46\DocumentFormat.OpenXml.dll + + + ..\packages\DocumentFormat.OpenXml.Framework.3.2.0\lib\net46\DocumentFormat.OpenXml.Framework.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.1d.writer.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.2d.writer.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.DWG.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Common.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Document.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Email.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.HTML.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.Conversion.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Rendering.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.MSOfficeBinary.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenDocument.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.Templating.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.PDF.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.RTF.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.SVG.dll + + + ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.wia.gateway.dll + True + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll + ..\packages\NLog.5.1.0\lib\net46\NLog.dll + + ..\packages\OpenMcdf.2.4.1\lib\net40\OpenMcdf.dll + + + ..\packages\protobuf-net.3.2.46\lib\net462\protobuf-net.dll + + + ..\packages\protobuf-net.Core.3.2.46\lib\net462\protobuf-net.Core.dll + + + ..\packages\RtfPipe.2.0.7677.4303\lib\net45\RtfPipe.dll + + + ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + + ..\packages\System.CodeDom.8.0.0\lib\net462\System.CodeDom.dll + + + ..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll + @@ -82,15 +182,49 @@ + + ..\packages\System.IO.Packaging.8.0.1\lib\net462\System.IO.Packaging.dll + + + + ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + + ..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll + + + + ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + + ..\packages\System.Security.Cryptography.Pkcs.8.0.1\lib\net462\System.Security.Cryptography.Pkcs.dll + + + ..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + @@ -155,11 +289,11 @@ - + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - + \ No newline at end of file diff --git a/GUIs.Test.ZUGFeRDTest/packages.config b/GUIs.Test.ZUGFeRDTest/packages.config index 1a366059..2c8cef1d 100644 --- a/GUIs.Test.ZUGFeRDTest/packages.config +++ b/GUIs.Test.ZUGFeRDTest/packages.config @@ -1,9 +1,35 @@  + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file