Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 423
  • Last Modified:

datagridview degradation and form focus

I have a form with a large dgv on it that always degrades when something else on the screen is clicked.  Does anyone know why?  I have a function that refreshes the grid when another panel is shown and then returned to the panel with the grid which works fine, albeit a little screen flicker.  Is there a way to know when the form is now the one with focus on the screen so that the refresh function can be called?
0
ddepuemd
Asked:
ddepuemd
  • 3
1 Solution
 
ddepuemdAuthor Commented:
Hey experts!  Doesn't anyone know how to fix this?

The first picture is a normal display, without this line in the cell painting method:

e.AdvancedBorderStyle.Bottom = DataGridViewAdvancedCellBorderStyle.InsetDouble

the second picture is with the line in the method.  How do I fix this?  The code is necessary in order to paint the red lines, which is essential.  HELP!
good-display.jpg
bad-display.jpg
0
 
ddepuemdAuthor Commented:
the second picture is only what happens to the display when another window is dragged over the grid.
0
 
ddepuemdAuthor Commented:
I found the answer.  Rather than draw the lines in the cellpainting event, I draw them in the dgv.paint event.  
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now