simple error?

Posts 1–6 of 6 · Page 1 of 1
simple error?
HAHA it was a simple error i understand it now. but here is the bad source. find the problem with it anyways?

Mods:
/Close

Code:
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
Quote Originally Posted by gwentravolta View Post
HAHA it was a simple error i understand it now. but here is the bad source. find the problem with it anyways?

Mods:
/Close

Code:
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
?? What was this supposed to do??
Quote Originally Posted by Pixie View Post
?? What was this supposed to do??
It has something to do with changing the background color of a form. (I think)
Quote Originally Posted by Iamazn View Post
It has something to do with changing the background color of a form. (I think)
Well that's EASY!!
I think its something else now (Check his other thread)
@PixieCrop
IF I was right, he wanted to change the form color depending on what a user typed.
Quote Originally Posted by Iamazn View Post
I think its something else now (Check his other thread)
@PixieCrop
IF I was right, he wanted to change the form color depending on what a user typed.
Yep, that's it. But I'm having a different problem on my other thread. I resolved this one.

http://www.mpgh.net/forum/33-visual-...r-i-think.html
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us