On Wed, 16 May 2007 05:17:59 -0700, ofiras <of****@gmail.comwrote:
I'm using paint event to draw something with graphics, but sometimes,
it draws it in a wrong place - like he think that the form starts in
minus, he draws it a little to the left, and up.
Dose someone knows why this happens? It always does after some paint
events.
Without a concise (that is, short, brief, etc) example of code that
reliably reproduces the problem you're having, it would be impossible to
say why what you're seeing is happening.
Suffice to say, you're correct to assume it shouldn't happen. You've got
a bug somewhere in your code, or possibly in some third-party code that
you're using (if any). But without seeing the code, it's hard to say what
it might be.
Note that often in the process of putting together a suitable sample, you
will discover the bug that is causing the problem. That is, to create a
concise sample you have to remove a bunch of stuff from your actual code,
trimming to the bare essentials to get the bug to happen. When you do
this, often you'll find the problem goes away, and you have to start
adding things back in a little at a time to get it to come back.
Once you get to the point where you've just added a little more and the
bug came back, that's usually a pretty good pointer in the direction of
what is causing your bug. You may be able to fix it yourself, simply
through the exercise of preparing a sample for us to look at. :)
Pete