Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] TextBox Color Changer [Release]
#8
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
Reply


Messages In This Thread
RE: [Release] TextBox Color Changer [Release] - by RDCA - 10-11-2011, 07:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Guidtech [Better then HWID][WITH VB FILES!] The-One 5 6,663 08-07-2015, 06:18 AM
Last Post: darknessxk
  [Release] Password Enhancer v1.0 [/Release] Resistance 11 5,227 09-29-2013, 08:58 PM
Last Post: Resistance
  [Release] Print Spooler Utility euverve 0 938 03-26-2013, 08:52 AM
Last Post: euverve
  [Release] USB Drive Defender euverve 0 1,219 03-22-2013, 06:21 AM
Last Post: euverve
  [VB.NET] Advance Icon Changer BlackSpider 17 8,824 11-25-2012, 10:41 PM
Last Post: ƃu∀ ıʞƃu∀

Forum Jump:


Users browsing this thread: 2 Guest(s)