Imports System.Windows.Forms

Public Class CaptionDialog

  Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
    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 CaptionDialog_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    TextBox1.Focus()
    TextBox1.Font = New System.Drawing.Font(CaptionFont, NumericUpDown1.Value, FontStyle.Italic)
  End Sub

  Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged
    TextBox1.Font = New System.Drawing.Font(CaptionFont, NumericUpDown1.Value, FontStyle.Italic)
    TextBox1.Invalidate()
  End Sub
End Class
