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
