Um unter Visual Basic .NET eine Zufallsfarbe zu erhalten, genügt folgender (beinahe) Einzeiler:
Public Shared Function GetRandomColor() As Color Dim col As New Color Static rnd As Random If rnd Is Nothing Then rnd = New Random col = Color.FromArgb(rnd.Next(1, 255), rnd.Next(1, 255), rnd.Next(1, 255)) Return col End Function
0 Antworten zu Howto: Zufallsfarbe unter Visual Basic .NET