locked
Change BackColor of button to the value of a textbox RRS feed

  • Question

  • I am somewhat new to VB and creating a windows form. I am trying to automatically change the backcolor of a button when a value is entered into a textbox on the same form. When I change the name of the color in the text box, I want the backcolor of the button to change to this color automatically. It seems like I can only change the value of the backcolor by using "Color.Blue" or something like that but it give me errors when I set the backcolor value to TextBox1.Text. I am assuming this is something simple so I would appreciate any help.

    Kris

    Sunday, December 16, 2007 2:45 AM

Answers

  • Code Block

    YourButton.BackColor = Color.FromName(YourTextBox.Text)

     

     

    --

    Regards,

    Daniel Kuppitz

    Sunday, December 16, 2007 3:20 AM

All replies

  • Code Block

    YourButton.BackColor = Color.FromName(YourTextBox.Text)

     

     

    --

    Regards,

    Daniel Kuppitz

    Sunday, December 16, 2007 3:20 AM
  • Cool thanks

    Sunday, December 16, 2007 8:23 PM