Common/Dialog: Fix long messages

This commit is contained in:
Jonathan Jenne 2022-06-17 11:00:14 +02:00
parent e35f5c84c3
commit e328224d15
2 changed files with 18 additions and 17 deletions

View File

@ -26,7 +26,7 @@ Partial Class frmDialog
Me.btnPositive = New DevExpress.XtraEditors.SimpleButton()
Me.btnNegative = New DevExpress.XtraEditors.SimpleButton()
Me.pnlContent = New DevExpress.XtraEditors.PanelControl()
Me.txtContent2 = New DevExpress.XtraEditors.LabelControl()
Me.txtContent = New DevExpress.XtraEditors.LabelControl()
Me.SvgImageBox1 = New DevExpress.XtraEditors.SvgImageBox()
Me.pnlHeader = New DevExpress.XtraEditors.PanelControl()
Me.txtTitle = New DevExpress.XtraEditors.LabelControl()
@ -68,7 +68,7 @@ Partial Class frmDialog
'
'pnlContent
'
Me.pnlContent.Controls.Add(Me.txtContent2)
Me.pnlContent.Controls.Add(Me.txtContent)
Me.pnlContent.Controls.Add(Me.SvgImageBox1)
Me.pnlContent.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnlContent.Location = New System.Drawing.Point(0, 40)
@ -76,19 +76,19 @@ Partial Class frmDialog
Me.pnlContent.Size = New System.Drawing.Size(498, 131)
Me.pnlContent.TabIndex = 3
'
'txtContent2
'txtContent
'
Me.txtContent2.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtContent2.Appearance.Options.UseFont = True
Me.txtContent2.Appearance.Options.UseTextOptions = True
Me.txtContent2.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top
Me.txtContent2.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap
Me.txtContent2.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None
Me.txtContent2.Location = New System.Drawing.Point(71, 6)
Me.txtContent2.Name = "txtContent2"
Me.txtContent2.Size = New System.Drawing.Size(415, 119)
Me.txtContent2.TabIndex = 3
Me.txtContent2.Text = "LabelControl1"
Me.txtContent.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtContent.Appearance.Options.UseFont = True
Me.txtContent.Appearance.Options.UseTextOptions = True
Me.txtContent.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top
Me.txtContent.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap
Me.txtContent.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None
Me.txtContent.Location = New System.Drawing.Point(71, 6)
Me.txtContent.Name = "txtContent"
Me.txtContent.Size = New System.Drawing.Size(415, 119)
Me.txtContent.TabIndex = 3
Me.txtContent.Text = "LabelControl1"
'
'SvgImageBox1
'
@ -182,5 +182,5 @@ Partial Class frmDialog
Friend WithEvents SvgImageBox1 As DevExpress.XtraEditors.SvgImageBox
Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection
Friend WithEvents txtTitle As DevExpress.XtraEditors.LabelControl
Friend WithEvents txtContent2 As DevExpress.XtraEditors.LabelControl
Friend WithEvents txtContent As DevExpress.XtraEditors.LabelControl
End Class

View File

@ -28,7 +28,7 @@ Public Class frmDialog
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
txtContent2.Text = pMessageText
txtContent.Text = pMessageText
txtTitle.Text = pTitle
Select Case pDialogType
@ -62,11 +62,12 @@ Public Class frmDialog
End Select
Dim oLineBreaks = txtContent2.Text.Split(vbNewLine).Count
Dim oLineBreaks = txtContent.Text.Split(vbNewLine).Count
If oLineBreaks > 6 Then
Dim oHeightOffset = oLineBreaks * 20
Height += oHeightOffset
txtContent.Height += oHeightOffset
End If
btnPositive.Focus()