473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

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

regards,
supra
Nov 21 '05 #1
4 2738
Hi,

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

"Supra" <su*****@rogers .com> wrote in message news:ft******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(B yVal BgColour As Integer, ByVal FgColour As Integer)
SelectionHighli ghtBackColour(B gColour)
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.FromKnown Color(CType(FgC olour, KnownColor))

Imran.

"Shiva" <sh******@onlin e.excite.com> wrote in message
news:u4******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

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

"Supra" <su*****@rogers .com> wrote in message
news:ft******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(B yVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighli ghtBackColour(B gColour)
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******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(B yVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighli ghtBackColour(B gColour)
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.selectionco lor=color(gfCol our) 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.ForeColo r = Color.FromKnown Color(CType(FgC olour, KnownColor))

Imran.

"Shiva" <sh******@onlin e.excite.com> wrote in message
news:u4******* *********@tk2ms ftngp13.phx.gbl ...
Hi,

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

"Supra" <su*****@rogers .com> wrote in message
news:ft******* ************@ne ws04.bloor.is.n et.cable.rogers .com...
value of type "Integer" cannot be convert to system.color

Public Sub APIHighlight2(B yVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighli ghtBackColour(B gColour)
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
3933
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> </xs:complexContent> </xs:complexType> </xs:element>
1
2161
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 don't get it it should be System.Int32 or some other integer type but not a decimal. Any ideas why this is happening? btw: I'm using msxml 4.0. ...
3
84681
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 6 C compiler. Thanks in advance! Evan
4
3461
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 code here? the first time I ran the code it worked,
2
1251
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 .. .. .. fColor=Colour(fgcolor) ===> error occured in fgcolour .. ..
2
7200
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 'ASP.multiclasses_aspx.VehicleKey'. Source Error: Line 106:
20
12386
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
26890
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. The code in txt1 works OK but I am asking is there a better way of coding this Public Class Main
1
24462
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 always seem to add things a a string? Later in my code, I try to sort based on "View_Order", but it acts like a string. The values sort as...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.