473,395 Members | 1,996 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,395 software developers and data experts.

Value of type 'System.Drawing.Color' cannot be converted to 'Intege

: error BC30311: Value of type 'System.Drawing.Color' cannot be
converted to 'Integer'.

Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional
ByVal f As Integer = 0, Optional ByVal bg As Integer = 0)
Dim b As String, n, fgcolor, bgcolor As Integer

Dim colour(15) As Color
colour(0) = Color.White
colour(1) = Color.Black
colour(2) = Color.DarkBlue
colour(3) = Color.DarkGreen 'dark green
colour(4) = Color.Red 'red
colour(5) = Color.Brown
colour(6) = Color.Purple
colour(7) = Color.Orange
colour(8) = Color.Yellow
colour(9) = Color.LightGreen 'light green
colour(10) = Color.DarkMagenta 'dark blue green
colour(11) = Color.SkyBlue
colour(12) = Color.Blue 'light blue
colour(13) = Color.Magenta 'magenta
colour(14) = Color.Gray
colour(15) = Color.LightSlateGray

..
..
.. f = ColorTranslator.ToWin32(colour(fgcolor))
rtb.backcolour = colour(bgcolor) ===> error
occured here
APIHighlight2(bg, colour(fgcolor))
Debug.WriteLine(fgcolor)
...
..
..
..
..
End Function

how do i convert colour(bgcolor) into rtb.backcolor. this is irc chat
colour similar to mirc. it will worked in vb6. i tried this:...
ColorTranslator.ToWin32
color.fromArg
color.fromknowcolor
ColorTranslator.ToOle
directcast
ctype

regards,

Nov 22 '05 #1
0 2204

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chumley the Walrus | last post by:
I'm using this sql parameter: MyCommand.Parameters("@Sport").value = Server.HtmlEncode(sport) to get a value from a textbox control: <asp:TextBox Name="sport" id="sport"...
8
by: Chris Dunaway | last post by:
When using a PropertyGrid, I have an object with a Date property, but I am only interested in the Time portion. How do I make the PropertyGrid allow editing the time only? Just the hours and...
0
by: Supra | last post by:
: error BC30311: Value of type 'System.Drawing.Color' cannot be converted to 'Integer'. Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional ByVal f As Integer = 0, Optional...
2
by: Sean | last post by:
Hello, I have a function in C# that accepts a stored proc name and an array of parameters, and then returns a dataset, which works just fine. I have converted the function to VB: Public Shared...
1
by: Supra | last post by:
: error BC30311: Value of type 'System.Drawing.Color' cannot be converted to 'Integer'. Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional ByVal f As Integer = 0, Optional...
6
by: Sameh Ahmed | last post by:
Hello there I need to get the "PwdLastSet" of a user object to know when he last set his password. I am using DirectoryServices.DirectoryEntry to bind to the user object, but it either gives...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
3
by: news.microsoft.com | last post by:
I got this error "Object type cannot be converted to target type" in my VB Winforms application. When I click on it, it goes no where, how do I troubleshoot this? Thank you.
13
by: Jim in Arizona | last post by:
I made a page with a gridview that has rows show a different color if a number in a column is greater than or equal to 45. I also did this conditional formatting for the column next to it. Here's...
9
by: Eric | last post by:
Hi Everyone, I'm writing a UserControl that exposes a property of the type System.Drawing.Image, like this: Public Property DefaultImage() As Image Get Return propDefaultImage End Get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.