In VB6 I would do something like:
Code:
	Private Sub DoColors()
		Dim FormControl As Control
		For Each FormControl In Me.Controls
			CType(FormControl, WebControl).BackColor = (New Color).FromArgb(RGB(CType(Rnd() * 255, Integer), CType(Rnd() * 255, Integer), CType(Rnd() * 255, Integer)))
		Next
	End Sub
But this doesn't work.
It errors on:
Code:
CType(FormControl, WebControl).BackColor
Saying it's an invalid typecast

Woka