Help, Color Dialog

jamesy2j

New member
Joined
Apr 19, 2006
Messages
1
Programming Experience
Beginner
I'm having some problems with a text editor im creating.
Im calling the Colour Dialog to change the selected text to an a Colour of the users choice.

The problem im getting is that vb aint liking "cdColour.Color" it says;
Value of type 'System.Drawing.Color' cannot be converted to 'String'

My code Follows as

Private Sub mnuColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuColor.Click
cdColour.ShowDialog()
txtDisplay.SelectedText() = cdColour.Color
End Sub

If anyone could help, would be great help for me

Thanks James
 
I would suggest using of RTB control for the purpose. Then you can simply say:
VB.NET:
[SIZE=2][COLOR=#0000ff]If [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ColorDialog1.ShowDialog = DialogResult.OK [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]   Me[/COLOR][/SIZE][SIZE=2].RTB1.[SIZE=2]SelectionColor[/SIZE] = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ColorDialog1.Color
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]

Regards ;)
 
Back
Top