Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rbg1, rbg2, rbg3 As Integer
If TextBox1.Text = "" Then
TextBox1.Text = "0"
ElseIf TextBox1.Text > "255" Then
TextBox1.Text = "255"
Else
rbg1 = TextBox1.Text
End If
If TextBox2.Text = "" Then
TextBox2.Text = "0"
ElseIf TextBox2.Text > "255" Then
TextBox2.Text = "255"
Else
rbg2 = TextBox2.Text
End If
If TextBox3.Text = "" Then
TextBox3.Text = "0"
ElseIf TextBox3.Text > "255" Then
TextBox3.Text = "255"
Else
rbg3 = TextBox3.Text
End If
Me.BackColor = Color.FromArgb(rbg1, rbg2, rbg3)
End Sub
End Class