1st:-Make a function to generate random color
Private Function CreateRandomColor() As Color
Dim randonGen As New Random()
Dim randomColor As Color = Color.FromArgb(randonGen.[Next](255), randonGen.[Next](255), randonGen.[Next](255))
Return randomColor
End Function
Imports System.Windows.Media
Partial Public Class Settings
Inherits PhoneApplicationPage
Public Sub New()
InitializeComponent()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
Dim color As Color
color= CreateRandomColor()
While (color != White or Red or Blue or Green) 'Specify color names u want
LayoutRoot.Background = New SolidColorBrush(color)
color = CreateRandomColor()
End While
End Sub
End Class