By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.