|
-
May 11th, 2019, 02:37 AM
#1
Thread Starter
New Member
[RESOLVED] Help! Backcolor only changes the first element of a control array's color
I've createda small code which turns a command button red after pressing it. There are multiple command buttons in the array, all called C2. There are also the C1's and the C0's. This is the code:
Code:
Private Sub C2_Click(a As Integer)
C2(a).BackColor = &HC0&
C2(a).Enabled = False
C1(a).Enabled = False
C0(a).Enabled = False
puntos = puntos + 2
PPP.Caption = puntos
End Sub
Whenever I run it, everything works fine except for the backcolor, which only works when pressing the first one. After a little experimenting I found out that no matter whether I change it to something like:
Code:
C2(3).BackColor = &HC0&
It still won't work. What's more is that if I do it like that the first one (C2(0)) won't work.
Any idea as to why this happens?
-
May 11th, 2019, 04:51 AM
#2
Re: Help! Backcolor only changes the first element of a control array's color
Is the Style Graphical for all of your CommandButton controls?
-
May 11th, 2019, 05:14 AM
#3
Thread Starter
New Member
Re: Help! Backcolor only changes the first element of a control array's color
Oh! That was it, thanks! I can't believe I didn´t see that
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|