Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8404483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:36:41+00:00 2026-06-09T22:36:41+00:00

After I figured out how to change the different cell’s border colors using the

  • 0

After I figured out how to change the different cell’s border colors using the RGB values to generate a random color, I now want to change the background color of each cell as well. This is for DataGridView. Below is my relevant code that allowed me to change cell border colors and now somewhere in that code lies a way to change background color of each cell but I am not familiar with this code since it is from a freeware. Does anyone know what I must change in this code to affect the background color of each cell?

Here is my code:

http://pastebin.com/WNBReUys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:36:43+00:00Added an answer on June 9, 2026 at 10:36 pm

    The solution printing a background color is similar to the pen solution except you need to use a brush, usually a SolidBrush:

    Dim brushColor as New SolidBrush(someColor)
    
    e.Graphics.FillRectangle(brushColor ,_
                             New Rectangle(ColumnLeft(ColPage, ColAt), _
                                           tmpTop, _
                                           ColumnWidth(ColPage, ColAt), _
                                           CellHeight))
    

    Note that since you are drawing text and other graphics on this rectangle, you probably want to paint the background color first, before all the other graphics. (Otherwise, you will end up with only a solid colored rectangle with no text.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After a while I figured out I could bind Shark to the process of
After some trial and error (ok, just error) I figured out that c089b69c3d contained
After so many years using ASP.Net, I’m still trying to figure out how to
After trying to figure out why a Capistrano task (which tried to start a
After wasting some time to figure out what goes wrong, I finally have to
I'm trying to figure out whether the code located after throw new Exception in
I'm trying to figure out how to show validation errors after a user submits
I've been trying to figure out a way to update the interface after each
I'm trying to figure out how my iOS app should work after Facebook make
I am trying to figure out how to do the following: 1) After a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.