value of type "Integer" cannot be convert to system.color....

S

Supra

value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(ByVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighlightBackColour(BgColour)
Dim rtb As New RichTextBox
rtb.ForeColor = FgColour ===> error occured in fgcolour
End Sub

regards,
supra
 
S

Shiva

Hi,

Try: rtb.ForeColor = Color.FromArgb(FgColour)

value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(ByVal BgColour As Integer, ByVal FgColour As Integer)
SelectionHighlightBackColour(BgColour)
Dim rtb As New RichTextBox
rtb.ForeColor = FgColour ===> error occured in fgcolour
End Sub

regards,
supra
 
I

Imran Koradia

Or if you are specifying the color as a known color, that is, the integer
corresponds to one of the KnownColor enums values, then you can also do
something like this:
rtb.ForeColor = Color.FromKnownColor(CType(FgColour, KnownColor))

Imran.

Hi,

Try: rtb.ForeColor = Color.FromArgb(FgColour)

value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(ByVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighlightBackColour(BgColour)
Dim rtb As New RichTextBox
rtb.ForeColor = FgColour ===> error occured in fgcolour
End Sub

regards,
supra
 
S

Supra

btw i'm doing irc chat colour similar to mirc chat. i have done this in
vb6 using miscrosft richtextbox's control that can enable background
and foreground colour. now i can't get background colour all i got is
rtb.selectioncolor=color(gfColour) that fine with me. but now i'm
attempting to get back into real vb.net .
thank.
regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top