Changing Text colour in text field by dropdown menu - Visual Studio 2008

Posted by Wayne on Stack Overflow See other posts from Stack Overflow or by Wayne
Published on 2010-03-15T10:55:34Z Indexed on 2010/03/15 10:59 UTC
Read the original article Hit count: 249

Filed under:

Hey, i'm just doing some testing on Visual Studio 2008, what i'm trying to do is to change the text colour inside the multi-textfield which isn't working and I don't know why...

Public Class Form1
Dim ColourValue As Color

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    rbBlue.Checked = False
    rbRed.Checked = False
    rbGreen.Checked = False
End Sub

Private Sub rbRed_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbRed.CheckedChanged
    txtSpace.BackColor = Color.Red
End Sub

Private Sub rbBlue_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbBlue.CheckedChanged
    txtSpace.BackColor = Color.Blue
End Sub

Private Sub rbGreen_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbGreen.CheckedChanged
    txtSpace.BackColor = Color.Green
End Sub

Private Sub cbColours_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbColours.SelectedValueChanged

    ColourValue = cbColours.SelectedValue
    txtSpace.BackColor = ColourValue

End Sub
End Class

Basically i have the radio buttons that would change the background colour of the textfield, but i just need the dropdown menu to change the text colour.

Many thanks :)

© Stack Overflow or respective owner

Related posts about visual-studio-2008