OK, as I cannot do it that way, I have found a work-round, and am posting it in case anyone else has the same issue:
First I defined a variable ButtonColour as Int in the main Process_Globals.
Then, in the main Activity_Create I added
Dim Test As Button
test.Initialize (test)
ButtonColour = test.TextColor
test.RemoveView
before I loaded a layout.
Now, each time I load a layout I call
General.ColourButtons (Activity )
or
General.ColourButtonsP (PanelName )
depending if the layout was added to an activity or a panel.
I then put the following subs in my General module:
Sub ColourButtons (Value As Activity)
Dim DummyB As Button
Dim DummyP As Panel
For i = 0 To Value.NumberOfViews - 1
If Value.GetView(i) Is Button Then
DummyB = Value.GetView (i)
DummyB.TextColor = main.ButtonColour
End If
If Value.GetView (i) Is Panel Then
DummyP = Value.GetView (i)
For l = 0 To DummyP.NumberOfViews - 1
If DummyP.GetView (l) Is Button Then
DummyB = DummyP.GetView (l)
DummyB.TextColor = main.ButtonColour
End If
Next
End If
Next
End Sub
Sub ColourButtonsP (Value As Panel)
Dim DummyB As Button
Dim DummyP As Panel
For i = 0 To Value.NumberOfViews - 1
If Value.GetView(i) Is Button Then
DummyB = Value.GetView (i)
DummyB.TextColor = main.ButtonColour
End If
If Value.GetView (i) Is Panel Then
DummyP = Value.GetView (i)
For l = 0 To DummyP.NumberOfViews - 1
If DummyP.GetView (l) Is Button Then
DummyB = DummyP.GetView (l)
DummyB.TextColor = main.ButtonColour
End If
Next
End If
Next
End Sub
and it all works perfectly.
The above two routines are exactly the same as I could not figure out how to deal with activities and panels at the same time (anyone any ideas):sign0085:.
All that is left is the "+" buttons in the dialogs, which is on agrahams list.