Android Question Need Idea

tufanv

Expert
Licensed User
Hello

I need an idea about something. I have 16 different panel which positioned into the screenas 4x4 . ( 4 rows and 4 coloumns as squares )
I want to change the background of 3rd row only to yellow( I dont want to code panel9,10,11,12 because panels will switch positions ) so I have to identify the panels at the 3rd row.

Can you give an idea how can i identify the 3rd rows panel names for example ?

TY
 

klaus

Expert
Licensed User
You could define an array of panels.
Dim Panel1, Panel2, Panel3, Panel4, Panel5, Panel6, Panel7, Panel8, Panel9, Panel10, Panel11, Panel12, Panel13, Panel14, Panel15, Panel16 As Panel
Dim Panels(16) As Panel
Panels = Array As Panel (Panel1, Panel2, Panel3, Panel4, Panel5, Panel6, Panel7, Panel8, Panel9, Panel10, Panel11, Panel12, Panel13, Panel14, Panel15, Panel16)

Then you know that Panels(8) to Panels(11) are the panels in the 3rd row.
 

mangojack

Well-Known Member
Licensed User
I dont want to code panel9,10,11,12 because panels will switch positions
When the panels switch position .. surely code would identify those going to 3rd row.
Maybe set the tag to again identify which panels are to be colored yellow.

Edit .. Or loop thru the panels and if Panel.Top = certain value then Panel.Color = Color.Yellow
 

tufanv

Expert
Licensed User
Thank Yu Klaus ! but when panels switch position how can i identify them ? For example panel1 will switch positions with panel 9 and 3rd will no more will be panel9 10 11 12 but it will be panel 1 10 11 12

You could define an array of panels.
Dim Panel1, Panel2, Panel3, Panel4, Panel5, Panel6, Panel7, Panel8, Panel9, Panel10, Panel11, Panel12, Panel13, Panel14, Panel15, Panel16 As Panel
Dim Panels(16) As Panel
Panels = Array As Panel (Panel1, Panel2, Panel3, Panel4, Panel5, Panel6, Panel7, Panel8, Panel9, Panel10, Panel11, Panel12, Panel13, Panel14, Panel15, Panel16)

Then you know that Panels(8) to Panels(11) are the panels in the 3rd row.
 
Top