my drawing is missing!!??[emergency]
-
i use DrawRectangle to draw shapes in vb.net form..then i minimize the form and restore again, my rectangle is missing?!!!same happen to other type of shapes!! anyone can help me plz....:((
Have you heard the story of the "Boy who cried 'wolf'"? Of your six posts on this forum 4 have carried the word "Emergency" and 1 has used the word "Urgent". Are they real emergencies? Will someone die if the answer is not found? All I am asking is that you tone down this sort of language because people will become desensitised to it. From my experience: Emergencies in software development are rare. Often if I get stuck on one part of a system I can post a question and move on to a different part. If/when someone replies I can go back and try their suggestion. To your specific problem: Are you using
DrawRectangle
in the Paint event handler. The reason is that when any window is minimised or another window drawn on top then the contents of the window become damaged. The Operating System will not keep track of what is being drawn on the window, that is your job. If you draw with basic tools likeDrawRectangle
then you have to draw each time the window gets damaged. Normally when a window is damaged and needs to be redrawn Windows will issue a Paint event. You must handle this event and perform your drawing. --Colin Mackay--"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#
-
Have you heard the story of the "Boy who cried 'wolf'"? Of your six posts on this forum 4 have carried the word "Emergency" and 1 has used the word "Urgent". Are they real emergencies? Will someone die if the answer is not found? All I am asking is that you tone down this sort of language because people will become desensitised to it. From my experience: Emergencies in software development are rare. Often if I get stuck on one part of a system I can post a question and move on to a different part. If/when someone replies I can go back and try their suggestion. To your specific problem: Are you using
DrawRectangle
in the Paint event handler. The reason is that when any window is minimised or another window drawn on top then the contents of the window become damaged. The Operating System will not keep track of what is being drawn on the window, that is your job. If you draw with basic tools likeDrawRectangle
then you have to draw each time the window gets damaged. Normally when a window is damaged and needs to be redrawn Windows will issue a Paint event. You must handle this event and perform your drawing. --Colin Mackay--"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#
-
i use DrawRectangle to draw shapes in vb.net form..then i minimize the form and restore again, my rectangle is missing?!!!same happen to other type of shapes!! anyone can help me plz....:((
Hi MJAY... You will need to store the points you have used to create the rectangle in an array or a file.. Then in the paint event you will have to recreate all the objects drawn in that control.. Hope this Helps.. Thanks !:) Manoj Madhavam