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

Thread: Make backcolor darker

  1. #1
    Join Date
    Jan 2009
    Posts
    161

    Make backcolor darker

    Hi,I have the following code for my datagrid backcolor.But I would like my gray color to be darker 20% then the original gray color,is it we can do it?

    Code:
     PODetailsGrid.AlternatingItemStyle.BackColor = Color.Gray

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    15,002

    Re: Make backcolor darker

    If you hover the mouse over the color, you will see it's data type. You'd have to calculate the value, subtract 20% and use that. Color is a set of 3 numbers between 0 and 255
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,101

    Re: Make backcolor darker

    Why not just use Color.DarkGray and Color.LightGray and Color.Gray ¿

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center