Support Forums

Full Version: [Release] TextBox Color Changer [Release]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
[Image: YzwzC.png]

Hey guys. Resistance is back and I will be staying here for a while, not like the other times.

Note: Not that much work is put into this applet...

Preview:
[Image: gg2wg.png]

Here is the download link:
Code:
http://www.mediafire.com/?5lvu79lw1xylnx8

Now I have created an nice little application as a challenge I suppose as an SF Coder, I assume we will have these annually released from time to time.





Source Code:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If ComboBox1.SelectedItem = "Red" Then
            Tc.ForeColor = Color.Red
        End If
        If ComboBox1.SelectedItem = "Dark Red" Then
            Tc.ForeColor = Color.DarkRed
        End If
        If ComboBox1.SelectedItem = "Blue" Then
            Tc.ForeColor = Color.Blue
        End If
        If ComboBox1.SelectedItem = "Dodger Blue" Then
            Tc.ForeColor = Color.DodgerBlue
        End If
        If ComboBox1.SelectedItem = "Yellow" Then
            Tc.ForeColor = Color.Yellow
        End If
        If ComboBox1.SelectedItem = "Muddy Yellow" Then
            Tc.ForeColor = Color.LightGoldenrodYellow
        End If
        If ComboBox1.SelectedItem = "Green" Then
            Tc.ForeColor = Color.Green
        End If
        If ComboBox1.SelectedItem = "Lime" Then
            Tc.ForeColor = Color.Lime
        End If
        If ComboBox1.SelectedItem = "White" Then
            Tc.ForeColor = Color.White
        End If
        If ComboBox1.SelectedItem = "Brown" Then
            Tc.ForeColor = Color.Brown
        End If
        If ComboBox1.SelectedItem = "Black" Then
            Tc.ForeColor = Color.Black
        End If
        If ComboBox1.SelectedItem = "Purple" Then
            Tc.ForeColor = Color.Purple
        End If
        If ComboBox1.SelectedItem = "Magenta" Then
            Tc.ForeColor = Color.Magenta
        End If
        If ComboBox1.SelectedItem = "Orange" Then
            Tc.ForeColor = Color.Orange
        End If
        If ComboBox1.SelectedItem = "Dark Orange" Then
            Tc.ForeColor = Color.DarkOrange
        End If
    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        Process.Start("http://www.supportforums.net/reputation.php?uid=4502")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ComboBox1.Text = ""
        Tc.Text = "(Type Anything You Want)"
        Tc.ForeColor = Color.Black
    End Sub
End Class

Thanks for the release. I will have to download this and give it a look.
Nice little project, so this changes the color of the textbox text? You know you can do that with a colordialogbox.
(10-11-2011, 04:15 PM)Digital-Punk Wrote: [ -> ]Nice little project, so this changes the color of the textbox text? You know you can do that with a colordialogbox.
Yes it does, actually pretty cool.
(10-11-2011, 04:15 PM)Digital-Punk Wrote: [ -> ]Nice little project, so this changes the color of the textbox text? You know you can do that with a colordialogbox.

Ehhh, I suppose so. I just wanted to get over it with. I wasn't thinking critically for a hardcore utility if you get what I mean. It still is something. I have a lot of work ahead of me right now; that program I made is a complete scrap to me, I can program much better than that.
(10-11-2011, 04:25 PM)Resistance Wrote: [ -> ]Ehhh, I suppose so. I just wanted to get over it with. I wasn't thinking critically for a hardcore utility if you get what I mean. It still is something. I have a lot of work ahead of me right now; that program I made is a complete scrap to me, I can program much better than that.

Lol, I see what your saying. I believe you could program better than that. It is a good project though. Nice share.
Just a short little snippet, but still good.
Not to thread steal, but here is a more efficient version. I couldn't get the auto color loads to work properly so I had to look up a source for it. Using lots of if statements isn't good and you can also use the select case method next time. Its a lot less code.

Code:
Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Col As Color
        For Each f In System.Enum.GetNames(GetType(System.Drawing.KnownColor))
            Col = Color.FromName(f)
            If Col.IsSystemColor = False Then ComboBox1.Items.Add(Col)
        Next
        'Source for this http://www.vbdotnetforums.com/component-development/28782-color-combobox.html
    End Sub

    Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
        TextBox1.ForeColor = ComboBox1.SelectedItem
    End Sub
End Class
(10-11-2011, 07:43 PM)RDCA Wrote: [ -> ]Not to thread steal, but here is a more efficient version. I couldn't get the auto color loads to work properly so I had to look up a source for it. Using lots of if statements isn't good and you can also use the select case method next time. Its a lot less code.

Code:
Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Col As Color
        For Each f In System.Enum.GetNames(GetType(System.Drawing.KnownColor))
            Col = Color.FromName(f)
            If Col.IsSystemColor = False Then ComboBox1.Items.Add(Col)
        Next
        'Source for this http://www.vbdotnetforums.com/component-development/28782-color-combobox.html
    End Sub

    Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
        TextBox1.ForeColor = ComboBox1.SelectedItem
    End Sub
End Class

Yeah but not everyone knows the systems damn forcolors dude. Only us developers would know some besides the basics... Give some options jeez.

thankzz for sharing!!!!!! im newbie welcome me!!!!!!!!!!!
Pages: 1 2 3