CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Random Color

  1. #1
    Join Date
    Sep 2004
    Posts
    80

    Random Color

    How would i generate a random form background color? Thanks

  2. #2
    Join Date
    Sep 2004
    Location
    Sandhem, Sweden
    Posts
    20

    Re: Random Color

    Hi.

    Do you want a random RGB value or what?
    In that case do this.

    Code:
        Dim lRGB        As Long
            
        Randomize
        lRGB = RGB(CInt(255 * Rnd()), CInt(255 * Rnd()), CInt(255 * Rnd()))
    Regards,
    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured