drawing disappears in form
Posted on 2008-10-28
I've been working on a form that is used to design a trapezoidal channel. I have textboxes for depth, bottomwidth, sidelopes..etc. I have a picture box that i'm using to draw the channel based on the user input. I seem to have it working fine however at certain times the picturebox will refresh and erase my drawing with no event trigger. For instance sometimes when tabbing out of a textbox it happens. For a while the first time the form loaded and the drawing was triggered it would stay on the screen for approximately 2 seconds then disappear. That has since stopped but the drawing still disappears when i tab out of textboxes but not consistently. So after reading some similar problems on here i understand that i should use the paintEventArgs. I think i understand how to setup the sub to do what i want but there are no examples of how to call this sub routine. i don't understand what i'm suppose to use as arguments when i call the routine that draws my drawing. my Routine. Before i could just call my routine "DrawTrap(). I know i must be missing something simple because i've looked at dozens of examples and none of them answer this question. Can anyone help me out?