Home > Software engineering >  Be urgent! Questions about MFCGridCtrl display appear gray not filled areas
Be urgent! Questions about MFCGridCtrl display appear gray not filled areas

Time:09-27

I add a gridctrl in MFC applications, a scroll bar when adjust the table size, but the scroll bar to the bottom and the last time there will be a gray area, is gridctrl parent window's client area, I just don't want this area, including online example is the back and the bottom has a gray area, this certainly does not fit, could you tell me how to fill of gridctrl throughout the contain not shown scrolling the client area, tried many methods can't remove in the area, for the warrior who used gridctrl control guidance.

CodePudding user response:

Update control https://www.codeproject.com/Articles/8/MFC-Grid-control

Or registered class background brush change to white
Or modify EraseBkgnd fill the whole area

CodePudding user response:

Limited the scroll

CodePudding user response:

reference 1st floor zgl7903 response:
update control https://www.codeproject.com/Articles/8/MFC-Grid-control

Or registered class background brush change to white
Or modify EraseBkgnd fill the whole area

You just change the background color, I hope is when the scroll bar to the end of the table, just happens to be the edge of the client area, can not continue to pull the scroll bar area in the form, could you tell me how to solve it?

CodePudding user response:

If
M_nVScrollMax=VirtualRect. Height () - GetRowHeight (1);
?????

CodePudding user response:

reference 4 floor schlafenhamster response:
is
M_nVScrollMax=VirtualRect. Height () - GetRowHeight (1);
?????

Thank you, but that changed, the scroll bar and will appear after the last row or column display is not complete or not, no matter how adjustment data or m_nHSrollMax correlation value cannot solve, I don't know why,

CodePudding user response:

M_nHSrollMax to consider each column width

CodePudding user response:

refer to 6th floor schlafenhamster response:
m_nHSrollMax to consider each column width

Excuse me, how to set the best, when I put the Max to two extremes, add a 1 last row or column could not see, minus 1 and not the client area of the cell

CodePudding user response:

The principle is the rolling range is all the row and column

CodePudding user response:

Can try
M_GridCtrl. AutoSize (GVS_BOTH);
M_GridCtrl. SetRedraw (TRUE, TRUE);
  • Related