Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generating a Random Color in Visual Basic .NET
#1
Here is a helpful code snippit that I converted to Visual Basic .NET from Brandon's post in the Java forum.

This function returns a color with random red, green, and blue values.

Pastebin: http://pastebin.com/aS7hxDu5

[code2=vbnet]'This function returns a color with random red, green, and blue values

Function getRandomColor() As Color

Dim random As Random = New Random()
Return Color.FromArgb(random.Next(256), random.Next(256), random.Next(256))

End Function[/code2]


Messages In This Thread
Generating a Random Color in Visual Basic .NET - by Macatone - 09-03-2012, 10:47 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)