473,325 Members | 2,442 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,325 software developers and data experts.

compare colors

How can I test if a form has a specific color?

'This doesn't work
If (Me.BackColor = System.Drawing.SystemColors.Control) Then
Me.BackColor = Color.Tomato
End f

I tried some conversions which didn't work eather.

Thank you
Sincerely
Lore
Nov 21 '05 #1
5 3952
Lore Leunoeg wrote:
How can I test if a form has a specific color?

'This doesn't work
If (Me.BackColor = System.Drawing.SystemColors.Control) Then
Me.BackColor = Color.Tomato
End f

I tried some conversions which didn't work eather.

Thank you
Sincerely
Lore


See if this helps:
http://groups.google.com/group/micro...dedc3488?hl=en

Ben
Nov 21 '05 #2
Yes, this helped :)
Thank you very much.

Lore

"Ben Amada" <be*@REpoMOweVErpick.com> schrieb im Newsbeitrag
news:eC**************@TK2MSFTNGP09.phx.gbl...
Lore Leunoeg wrote:
How can I test if a form has a specific color?

'This doesn't work
If (Me.BackColor = System.Drawing.SystemColors.Control) Then
Me.BackColor = Color.Tomato
End f

I tried some conversions which didn't work eather.

Thank you
Sincerely
Lore
See if this helps:

http://groups.google.com/group/micro...dedc3488?hl=en
Ben

Nov 21 '05 #3
Hi,

Try something like this.

If Me.BackColor.Equals(System.Drawing.SystemColors.Co ntrol) Then
Me.BackColor = Color.Tomato
End If
Ken
-------------
"Lore Leunoeg" <lo*********@gmx.net> wrote in message
news:dj**********@news01.versatel.de...
How can I test if a form has a specific color?

'This doesn't work
If (Me.BackColor = System.Drawing.SystemColors.Control) Then
Me.BackColor = Color.Tomato
End f

I tried some conversions which didn't work eather.

Thank you
Sincerely
Lore

Nov 21 '05 #4
"Lore Leunoeg" <lo*********@gmx.net> schrieb:
How can I test if a form has a specific color?

'This doesn't work
If (Me.BackColor = System.Drawing.SystemColors.Control) Then

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/cad5236d90c3b46d>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
Be aware that there is a bug in the implementation of the Color.Equals
function that I reported to LadyBug:

http://lab.msdn.microsoft.com/Produc...0-f642a2f97b04

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ken Tucker [MVP]" <vb***@bellsouth.net> escribió en el mensaje
news:ua**************@TK2MSFTNGP10.phx.gbl...
Hi,

Try something like this.

If Me.BackColor.Equals(System.Drawing.SystemColors.Co ntrol) Then
Me.BackColor = Color.Tomato
End If
Ken

Nov 21 '05 #6

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

Similar topics

5
by: aznFETISH | last post by:
I have a list of links that I ue on my page, I alternate background colors for these links in a table, I usually do it using a DB but this list of link is manually added into the page so my...
4
by: alexis | last post by:
Hi, In a form I have the curent date <input name="datetoday" type="hidden" value="<? echo date("d/m/Y"); ?>"> and <input type=text name="datebox" size=15> The date format is d/m/Y...
3
by: Matt | last post by:
if (123 > 33) will return true and if ("123" > 33) will return true So my question is, if the above behaviors are the same?? If string is a number, and compare with another number, it will...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
11
by: Paul Smith | last post by:
I have a button on my web page the backcolor of which I want to change: btnSample.backcolor = ???????? I want the color to be Gainsboro However I enter Gainsboro or color.Gainsboro I have...
14
by: Dino M. Buljubasic | last post by:
I would like to be able to compare BackgroundImage Property of two picture boxes on my form. How can I do that? I am using : if (pctOne.BackgroundImage Is pctTwo.BackgroundImage) then //...
5
by: Lars Netzel | last post by:
How to I compare a Color, for example the CaptionBackColor of a DataGrid to see if it is a specific Color? The "Is" or "=" does'nt work regards /Lars Netzel
4
by: Jmc | last post by:
Hi Need some advice on how to get all colors in an image. I wish to have an input file, in my case it will be a scanned piece of fabric. I would like to first of all gen an array with all the...
1
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
3
by: jotr | last post by:
I didn't know where to post this question since it is an Excel question, but this was as close as I could get. The best way to ask my question is to give an example so...I have two worksheets in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.