An Integer Property Of 99 Becomes 220 When Assigned

K

Ken Ellis

When I assign a ClipRectangle.Top property of 99 to an integer it becomes
220.I am trying to understand how scrolling works when drawing directly on
the client area of a form with no controls. I am following one of
Charles Petzold examples to which I have added some diagnostic code to
try and follow what is happening. The OnPaint method is:

protected override void OnPaint(PaintEventArgs pea)
{
Graphics grfx = pea.Graphics;
Brush brush = new SolidBrush(ForeColor);
Point pt = AutoScrollPosition;

int CrT = pea.ClipRectangle.Top; // diagnostic

int tempY = pt.Y; // diagnostic

if (tempY < -60) // diagnostic
{
int temp = 88; // breakpoint set here
}
 
D

decrypted

can you post the rest of that code for the OnPaint metho? ...it sounds like
you have a ref being modified outside of what your showing here.
Additionaly, not sure if you are handling the graphics object correctly
without seeing the rest

-dec
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top