473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2717
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vijay | last post by:
<xs:element name="product"> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:integer"> <xs:attribute name="prodid" type="xs:positiveInteger"/> </xs:restriction>...
1
by: Ted | last post by:
I have some code which processes an xsd. For elements of type xs:integer the XmlSchemaDatatype object gotten from the schema elements ElementType member contains a ValueType of System.Decimal. I...
3
by: music4 | last post by:
Greetings, I need to use a long long data type integer in my program, but how to print it with printf() or an alternative? My platform is Solaris 2.7 32bit operating system, and I use Sun Forte...
4
by: Portroe | last post by:
on running debug I get the following error, ' cast from string "" to type 'integer' is not valid,' I am experimenting with file writing and reading, what sort of error am I looking for in my...
2
by: Supra | last post by:
value of type "Integer" cannot be convert to system.color. in procedure events: Function doColor(ByVal rtb As RichTextBox, ByVal a As String) Dim bColor, fColor, fgcolor, bgcolor As Integer .....
2
by: Jim in Arizona | last post by:
I'm learning form an ASP.NET 1.0 book and I tried out some code that returns this error: Compiler Error Message: BC30311: Value of type 'Integer' cannot be converted to...
20
by: chutsu | last post by:
I'm trying to compare between pointer and integer in an "IF" statement how do I make this work? if(patient.id != NULL){ } Thanks Chris
10
by: Dave griffiths | last post by:
Hi all Using VB2005 on Vista with a Norwegian locale setup. The test program has 3 textboxes the sum held in txt3. Using the code below, txt2 conversion causes an error when it is left empty....
1
by: Infog | last post by:
I have a dataview, and I am trying to "clone" its structure only in part, by creating a new table via code. I cut out most of the columns, so this is easier to read. My question is - Why does this...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.