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 = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
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(...) ?

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

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

Hope that helps.

commented: thanks a lot, i knew something's missing, i have this book but sometimes the code is not done properly +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.