spedbuch auswert; ReadT1ATEZ,Greenpulse API

This commit is contained in:
2026-09-23 07:35:12 +02:00
parent dbc0826321
commit 1c1af724c2
4 changed files with 163 additions and 55 deletions

View File

@@ -87,6 +87,107 @@ Public Class frmHauptfensterNew
End If
End Sub
Private pnlLeftOriginalWidth As Integer
Private Class ButtonScaleInfo
Public OriginalWidth As Integer
Public OriginalHeight As Integer
Public OriginalFontSize As Single
End Class
Private ReadOnly _buttonScaleInfos As New Dictionary(Of Button, ButtonScaleInfo)
Private Sub frmMain_Resize(sender As Object, e As EventArgs) Handles MyBase.ResizeEnd
pnlLeftOriginalWidth = 400
Dim Panel6OriginalWidth As Integer = 228
Dim screenWidth As Integer = Me.Width
Dim schwelle1 As Integer = 1500
Dim schwelle2 As Integer = 1920
If screenWidth <= schwelle1 Then
pnlLeft.Width = CInt(pnlLeftOriginalWidth * 0.6)
Panel6.Width = CInt(Panel6OriginalWidth * 0.0)
ElseIf screenWidth <= schwelle2 Then
pnlLeft.Width = CInt(pnlLeftOriginalWidth * 0.75)
Panel6.Width = CInt(Panel6OriginalWidth * 0.5)
Else
pnlLeft.Width = pnlLeftOriginalWidth
Panel6.Width = Panel6OriginalWidth
End If
'Buttons skalieren
Dim buttonFaktor As Double
If screenWidth <= schwelle1 Then
buttonFaktor = 0.7
ElseIf screenWidth <= schwelle2 Then
buttonFaktor = 0.8
Else
buttonFaktor = 1.0
End If
ScaleButtons(FlowLayoutPanel1, buttonFaktor)
ScaleButtons(splitMain.Panel2, buttonFaktor)
End Sub
Private Sub ScaleButtons(parent As Control, buttonFaktor As Double)
For Each ctrl As Control In parent.Controls
If TypeOf ctrl Is Button Then
Dim btn As Button = DirectCast(ctrl, Button)
'Originalwerte nur einmal speichern
If Not _buttonScaleInfos.ContainsKey(btn) Then
_buttonScaleInfos.Add(
btn,
New ButtonScaleInfo With {
.OriginalWidth = btn.Width,
.OriginalHeight = btn.Height,
.OriginalFontSize = btn.Font.Size
}
)
End If
Dim original As ButtonScaleInfo = _buttonScaleInfos(btn)
'Immer vom Original aus skalieren
btn.Width = CInt(original.OriginalWidth * buttonFaktor)
btn.Height = CInt(original.OriginalHeight * buttonFaktor)
btn.Font = New Font(
btn.Font.FontFamily,
original.OriginalFontSize * CSng(buttonFaktor),
btn.Font.Style
)
End If
'Untergeordnete Controls ebenfalls durchsuchen
If ctrl.HasChildren Then
ScaleButtons(ctrl, buttonFaktor)
End If
Next
End Sub
Private Sub frmHauptfenster_GotFocus(sender As Object, e As EventArgs) Handles MyBase.GotFocus
Timer1_Tick(Timer1, New EventArgs)
End Sub
@@ -414,6 +515,8 @@ Public Class frmHauptfensterNew
End If
End If
pnlLeftOriginalWidth = pnlLeft.Width
'MsgBox(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
Me.AutoScaleMode = AutoScaleMode.Dpi
hideErr.Interval = 3000
@@ -2014,6 +2117,8 @@ ELSE_ATILLA:
Me.Size = Screen.PrimaryScreen.WorkingArea.Size
' MsgBox(Me.Size.Height)
Details_aktiv = True
' If gridMyAviso.RowCount > 0 Then
'gridMyAviso.Rows(0).Selected = True
@@ -2099,6 +2204,8 @@ ELSE_ATILLA:
'Evtl abhängign vom User machen:
SWITCH_SEARCH("AVISO")
End Sub
Private Function getTbControlWidth(tbcntr) As Integer
@@ -4218,6 +4325,7 @@ ELSE_ATILLA:
Private Sub cbxChartNurGelesen_CheckedChanged(sender As Object, e As EventArgs) Handles cbxChartNurGelesen.CheckedChanged
VERAG_PROG_ALLGEMEIN.cGlobal.CHAT_NurGelesen = cbxChartNurGelesen.Checked
UsrCntlMessenger_ListNewChats1.initFontSizeSmaller()
UsrCntlMessenger_ListNewChats1.intiDGVChats()
End Sub
End Class