Public Class RoodGroenBlauw
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents TxtRood As System.Windows.Forms.TextBox
    Friend WithEvents TxtGroen As System.Windows.Forms.TextBox
    Friend WithEvents BtnTonen As System.Windows.Forms.Button
    Friend WithEvents BtnSluiten As System.Windows.Forms.Button
    Friend WithEvents TxtBlauw As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.TxtRood = New System.Windows.Forms.TextBox
        Me.TxtGroen = New System.Windows.Forms.TextBox
        Me.TxtBlauw = New System.Windows.Forms.TextBox
        Me.BtnTonen = New System.Windows.Forms.Button
        Me.BtnSluiten = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(8, 16)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(64, 32)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "&Rood"
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(8, 64)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(64, 32)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "&Groen"
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(8, 112)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(64, 32)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "&Blauw"
        '
        'TxtRood
        '
        Me.TxtRood.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtRood.Location = New System.Drawing.Point(112, 16)
        Me.TxtRood.MaxLength = 3
        Me.TxtRood.Name = "TxtRood"
        Me.TxtRood.Size = New System.Drawing.Size(104, 30)
        Me.TxtRood.TabIndex = 3
        Me.TxtRood.Text = ""
        '
        'TxtGroen
        '
        Me.TxtGroen.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtGroen.Location = New System.Drawing.Point(112, 64)
        Me.TxtGroen.MaxLength = 3
        Me.TxtGroen.Name = "TxtGroen"
        Me.TxtGroen.Size = New System.Drawing.Size(104, 30)
        Me.TxtGroen.TabIndex = 4
        Me.TxtGroen.Text = ""
        '
        'TxtBlauw
        '
        Me.TxtBlauw.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtBlauw.Location = New System.Drawing.Point(112, 112)
        Me.TxtBlauw.MaxLength = 3
        Me.TxtBlauw.Name = "TxtBlauw"
        Me.TxtBlauw.Size = New System.Drawing.Size(104, 30)
        Me.TxtBlauw.TabIndex = 5
        Me.TxtBlauw.Text = ""
        '
        'BtnTonen
        '
        Me.BtnTonen.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.BtnTonen.Location = New System.Drawing.Point(16, 184)
        Me.BtnTonen.Name = "BtnTonen"
        Me.BtnTonen.Size = New System.Drawing.Size(120, 48)
        Me.BtnTonen.TabIndex = 6
        Me.BtnTonen.Text = "Kleur tonen"
        '
        'BtnSluiten
        '
        Me.BtnSluiten.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.BtnSluiten.Location = New System.Drawing.Point(152, 184)
        Me.BtnSluiten.Name = "BtnSluiten"
        Me.BtnSluiten.Size = New System.Drawing.Size(120, 48)
        Me.BtnSluiten.TabIndex = 7
        Me.BtnSluiten.Text = "Sluiten"
        '
        'RoodGroenBlauw
        '
        Me.AcceptButton = Me.BtnTonen
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.BtnSluiten)
        Me.Controls.Add(Me.BtnTonen)
        Me.Controls.Add(Me.TxtBlauw)
        Me.Controls.Add(Me.TxtGroen)
        Me.Controls.Add(Me.TxtRood)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Name = "RoodGroenBlauw"
        Me.Text = "Rood-Groen-Blauw"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub TxtRood_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtRood.TextChanged

    End Sub

    Private Sub TxtAlgemeen_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TxtRood.Validating, TxtGroen.Validating, TxtBlauw.Validating
        Dim TxtAlgemeen As TextBox = CType(sender, TextBox)
        Try
            Dim kleurgetal As Byte = CType(TxtAlgemeen.Text, Byte)
        Catch ex As Exception
            MessageBox.Show("Tik een getal in tussen 0 en 255", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning)
        End Try
    End Sub

    Private Sub BtnTonen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTonen.Click
        Me.BackColor = Color.FromArgb(CByte(TxtRood.Text), CByte(TxtGroen.Text), CByte(TxtBlauw.Text))
    End Sub

    Private Sub BtnSluiten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSluiten.Click
        Me.Close()
    End Sub
End Class
