471,337 Members | 990 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

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

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
Nov 21 '05 #1
4 2542
Hi,

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

"Supra" <su*****@rogers.com> wrote in message news:ft*******************@news04.bloor.is.net.cab le.rogers.com...
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
Nov 21 '05 #2
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.

"Shiva" <sh******@online.excite.com> wrote in message
news:u4****************@tk2msftngp13.phx.gbl...
Hi,

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

"Supra" <su*****@rogers.com> wrote in message
news:ft*******************@news04.bloor.is.net.cab le.rogers.com...
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
Nov 21 '05 #3
thank

Shiva wrote:
Hi,

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

"Supra" <su*****@rogers.com <mailto:su*****@rogers.com>> wrote in
message news:ft*******************@news04.bloor.is.net.cab le.rogers.com...
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


Nov 21 '05 #4
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,

Imran Koradia wrote:
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.

"Shiva" <sh******@online.excite.com> wrote in message
news:u4****************@tk2msftngp13.phx.gbl...
Hi,

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

"Supra" <su*****@rogers.com> wrote in message
news:ft*******************@news04.bloor.is.net.ca ble.rogers.com...
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


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Vijay | last post: by
3 posts views Thread by music4 | last post: by
2 posts views Thread by Jim in Arizona | last post: by
20 posts views Thread by chutsu | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.