Yes, i know, But i have 3 seperate RGB colors (R, G and B) and i wanna compare them to backgrounds of controls to see if they match, in this case, i trigger a certain action ....
Originally posted by saracen Are the backgrounds of controls in Dec then?
is so y convert them to rgb?
Yes, i think they are. I don't specify them. I open the color dialog then choose a color at design time.
When back to runtime, i issue control.backcolor i get these numbers e.g. (-174.....). One more thing, my comparing numbers are RGB.
ok so when you get the decimals to RGB, remember that the colors are represented in decimals, so you would have to convert the RGB values to decimal by using RGB(red,green,blue) and then compare them. get what i mean
Remember, if someone's post was not helpful, you can always rate their post negatively .
if you form is red, and you are trying to see if you form is red or pink ,
if me.backcolor = 255 then '255 is red in decimals, or FF in hex
msgbox "hi"
end if
Remember, if someone's post was not helpful, you can always rate their post negatively .
Wait i'm a little bit lost lost here, this is my situation :
I have let's say three values, 225, 75 and 130 which represents the RGB colors. I want then to compare these to the backcolor of the controls to see if they match with existing controls.
If they do (match) i want to trigger a certain action.
Originally posted by rogergho Wait i'm a little bit lost lost here, this is my situation :
I have let's say three values, 225, 75 and 130 which represents the RGB colors. I want then to compare these to the backcolor of the controls to see if they match with existing controls.
If they do (match) i want to trigger a certain action.
You can use the RGB function to do this
Code:
If Command1.ForeColor = RGB(text1.text,text2.text,text3.text) then ...
Originally posted by BuggyProgrammer ok so when you get the decimals to RGB, remember that the colors are represented in decimals, so you would have to convert the RGB values to decimal by using RGB(red,green,blue) and then compare them. get what i mean
thats what i said up there why doesnt he listen to me
Remember, if someone's post was not helpful, you can always rate their post negatively .