devxlogo

January 5, 2004

GetRandomColor – Generating a random color

‘ Return a random color’ Example: Me.BackColor = GetRandomColor()Function GetRandomColor() As Color Dim rand As New Random Return Color.FromArgb(rand.Next(0, 256), rand.Next(0, 256), rand.Next(0, _ 256))End Function

The SystemInformation Class

System.Windows.Forms.SystemInformation is a little known class that exposes a number of static properties that return information about many system settings, such as: Icon and cursor size (IconSize and CursorSize properties)