Files
TaskFlow/app/TaskFlow/frmYesNo.vb
Developer01 040c7aeac0 2.7.3 WISAG
• Erweiterung von SetControlValues_FromControl um Handling für DevExpress DateEdit (Parsing verschiedener Datumsformate, Farbanpassung).
• Ergänzung einer analogen Fall-Branch für System.Windows.Forms.DateTimePicker (Fallback auf MinimumDateTime bei ungültigem oder leerem Caption).
• Keine bestehenden Funktionen außerhalb der neuen Select-Case-Zweige angepasst.
Nutzen: Ermöglicht dynamisches Setzen von Datumswerten aus SQL-Steuerdaten (Caption-Feld) für beide Datumstypen und konsistente Farbgestaltung wie bei anderen Steuerelementen.
Hinweis: Validierungs- und Logging-Struktur wiederverwendet; keine Seiteneffekte auf andere Control-Typen.
2025-11-19 13:02:27 +01:00

59 lines
2.1 KiB
VB.net

Imports System.Windows.Forms
Public Class frmYesNo
Dim oQuestion As String
Dim oCaption As String
Dim CommentInput As Boolean
Public oComment As String
Public Sub New(pQuestion As String, pCaption As String, pCommentSoFar As String, pCommentInput As Boolean)
MyBase.New()
oQuestion = pQuestion
oCaption = pCaption
oComment = pCommentSoFar
CommentInput = pCommentInput
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
If txtReason.Text = String.Empty And CommentInput = True Then
Dim oStop As String
If USER_LANGUAGE = "de-DE" Then
oStop = "Bitte eine Begründung eingeben!"
ElseIf USER_LANGUAGE = "es-ES" Then
oStop = "Introduzca un motivo!"
ElseIf USER_LANGUAGE = "en-US" Then
oStop = "Please enter a reason!"
ElseIf USER_LANGUAGE = "fr-FR" Then
oStop = "Veuillez saisir une justification!"
End If
MsgBox(oStop, MsgBoxStyle.Exclamation, ADDITIONAL_TITLE)
Exit Sub
End If
oComment = txtReason.Text
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Private Sub frmYesNo_Load(sender As Object, e As EventArgs) Handles Me.Load
txtQuestion.Text = oQuestion
txtReason.Text = oComment
If CommentInput = False Then
LabelControl1.Visible = False
txtReason.Visible = False
Me.Size = New Drawing.Size(455, 170)
Else
LabelControl1.Visible = True
txtReason.Visible = True
Me.Size = New Drawing.Size(455, 330)
End If
Me.Text = oCaption
End Sub
End Class