I'am trying to make a color mix program and is giving me this :Error Invalid Use Of Property.
I guess is because i have to put some values for colors, but i don't know how.
This is the code, hope somebody help me:

Private Sub Command1_Click()
Picture1.BackColor RGB(Text1, Text2, Text3)
End Sub

Private Sub Command2_Click()
Picture1.BackColor Form1.BackColor
Text1 = " "
Text2 = " "
Text3 = " "
End Sub

Private Sub Command3_Click()
End Sub

I'm assuming that Text1-3 are text boxes.
I'd grab their "text" properties, then cast them to integers.
In programmer-ese, that's

Picture1.BackColor RGB(cint(Text1.Text),cint(Text2.Text),cint(Text3.Text))

OK, now correct me if I'm wrong (It's been forever since VB6 for me), but doesn't this need an equal sign between Picture1.BackColor and RGB(...) ?


Also, I did some digging and it looks like you also need your Picture1.AutoRedraw set to true.

Hope that helps.

Edited 3 Years Ago by DeanMSands3

thanks a lot, i knew something's missing, i have this book but sometimes the code is not done properly
This question has already been answered. Start a new discussion instead.