UnKnowN 0 Posted April 17, 2006 Report Share Posted April 17, 2006 Private Sub Command1_Click() Dim a, b, c As Color Dim j, k, l As Integer a = Picture1.BackColor b = Picture2.BackColor c = Picture3.BackColor j = Int(Rnd * 3) + 1 If j = 1 Then a = RGB(255, 0, 0) End If If j = 2 Then a = RGB(0, 165, 255) End If If j = 3 Then a = RGB(30, 255, 30) End If k = Int(Rnd * 3) + 1 If k = 1 Then b = RGB(255, 0, 0) End If If k = 2 Then b = RGB(0, 165, 255) End If If k = 3 Then b = RGB(30, 255, 30) End If l = Int(Rnd * 3) + 1 If l = 1 Then c = RGB(255, 0, 0) End If If l = 2 Then c = RGB(0, 165, 255) End If If l = 3 Then c = RGB(30, 255, 30) End If End Sub O que é que está mal ? O erro dá-se em Dim a, b, c As Color User-defined type not-defined Quero agradecer desde já ao Ridelight, foi com o programa dele que consegui encontrar as perfect colors para a Slot http://ridelight.no.sapo.pt/simulador.html PS: Tenho 3 PictureBox's e 1 Botao Link to post Share on other sites
Tiago Salgado 2 Posted April 17, 2006 Report Share Posted April 17, 2006 Dá-te erro porque não te permite fazer esse tipo de declaração. Link to post Share on other sites
UnKnowN 0 Posted April 17, 2006 Author Report Share Posted April 17, 2006 Dá-te erro porque não te permite fazer esse tipo de declaração. Entao pkek o erro só da no c ? Link to post Share on other sites
vbmaster 2 Posted April 17, 2006 Report Share Posted April 17, 2006 sem saber a versão, nada feito... continuam a ignorar o post das regras! Link to post Share on other sites
Tiago Salgado 2 Posted April 17, 2006 Report Share Posted April 17, 2006 Dá-te erro porque não te permite fazer esse tipo de declaração. Entao pkek o erro só da no c ? Porque é a ultima variavel declarada...se acrescentares o "d" ele irá dar erro no d Link to post Share on other sites
UnKnowN 0 Posted April 18, 2006 Author Report Share Posted April 18, 2006 Dá-te erro porque não te permite fazer esse tipo de declaração. Entao pkek o erro só da no c ? Porque é a ultima variavel declarada...se acrescentares o "d" ele irá dar erro no d Hmm... ok... Mas entao como é que resolvo ? Não vejo onde esteja o rpoblema :| Link to post Share on other sites
Tiago Salgado 2 Posted April 18, 2006 Report Share Posted April 18, 2006 Em vez de pores a = Picture1.BackColor e dps tentares por a = RGB(0, 165, 255) metes tipo: If j = 1 Then Picture1.BackColor = RGB(255, 0, 0) End If Link to post Share on other sites
UnKnowN 0 Posted April 18, 2006 Author Report Share Posted April 18, 2006 Deu, Obrigadão Tiago Salgado. Este Moço é do Best LOL!! XD PS: 1º Post Editado Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now