469,946 Members | 1,800 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Value of type 'System.Drawing.Color' cannot be converted to 'Intege

: error BC30311: Value of type 'System.Drawing.Color' cannot be
converted to 'Integer'.

Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional
ByVal f As Integer = 0, Optional ByVal bg As Integer = 0)
Dim b As String, n, fgcolor, bgcolor As Integer

Dim colour(15) As Color
colour(0) = Color.White
colour(1) = Color.Black
colour(2) = Color.DarkBlue
colour(3) = Color.DarkGreen 'dark green
colour(4) = Color.Red 'red
colour(5) = Color.Brown
colour(6) = Color.Purple
colour(7) = Color.Orange
colour(8) = Color.Yellow
colour(9) = Color.LightGreen 'light green
colour(10) = Color.DarkMagenta 'dark blue green
colour(11) = Color.SkyBlue
colour(12) = Color.Blue 'light blue
colour(13) = Color.Magenta 'magenta
colour(14) = Color.Gray
colour(15) = Color.LightSlateGray

..
..
.. f = ColorTranslator.ToWin32(colour(fgcolor))
rtb.backcolour = colour(bgcolor) ===> error
occured here
APIHighlight2(bg, colour(fgcolor))
Debug.WriteLine(fgcolor)
...
..
..
..
..
End Function

how do i convert colour(bgcolor) into rtb.backcolor. this is irc chat
colour similar to mirc. it will worked in vb6. i tried this:...
ColorTranslator.ToWin32
color.fromArg
color.fromknowcolor
ColorTranslator.ToOle
directcast
ctype

regards,

Nov 22 '05 #1
0 1917

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Chumley the Walrus | last post: by
1 post views Thread by Supra | last post: by
7 posts views Thread by stephan querengaesser | last post: by
3 posts views Thread by news.microsoft.com | last post: by
13 posts views Thread by Jim in Arizona | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.