Hello all,

I am developing this little app in which there's a table and the user may scroll sideways to view the full table and choose to make an entry in any of the cells by clicking on the respective cell.

When the screen is not scrolled (m_nHScrollPos is zero) and when I click on a cell, the app creates a CEdit control in that particular cell and it's all good. However, when I scroll sideways (m_nHScrollPos > 0) to further reveal the table and then click on the cell which appears, the app creates a CEdit control which is offset greatly to the right (from it's actual required position).

It appears to be a problem with the origin to my inexperienced programmer mind. Please note that to bring about the scroll effect, in the OnPaint handler, I have used pDC->SetwindowOrg(m_nHscrollPos, m_nVScrollPos).

I'd be grateful if you could shed light on this problem. I've been working on this problem for quite a while already...

Thanks a lot, cheers.