Need some help in selecting a button and change the color on that

grafix4all

Member
Licensed User
Longtime User
For i = 1 To 10 'makes 10 button
Dim buttonbordnummer As Button
buttonbordnummer.Initialize("ButtonBordNummer")
PanelValgBord.AddView(buttonbordnummer, 10dip, 10dip + 45dip * i, 60dip, 45dip)
buttonbordnummer.Text=i
Next
end sub
,---------------------------------------------

Sub ChangeTheColor
for a = 1 to 10
'I know that's wrong - But I can't figure out how to select the right button
buttonbordnummer.Text="test"
next
end sub



Pls help - I am newbie
 

KMatle

Expert
Licensed User
Longtime User
Same problem: Create e.g. 10 buttons.

How do I address the 5th button like button(5).Text = "I am #5"

Inside the loop there is no itemnumber or something else given.

I would have expected: Dim Button(i) ... but it is only Dim Button without an index. It's like you add ONE view by name.
 
Upvote 0

grafix4all

Member
Licensed User
Longtime User
Klaus exactly what I mean

I don't click on any of these 10 buttons - I just have to change fx the color on one or more these buttons.
So how do I change the properties on these buttons and how do I select the right one. :)
 
Upvote 0
Top