I am using a Graphics object to draw on a form. If I pop up a message
box, or if say the user minimizes and then restores the form, my
graphics are erased (just where the box was in the former case).
Do I have to detect these things and redraw, or is there a way to
prevent this from happening?
--
To Email Me, ROT13 My Shown Email Address 4 1338
"John Baker" <wb********@wzwfreivprf.pbz> schrieb: I am using a Graphics object to draw on a form. If I pop up a message box, or if say the user minimizes and then restores the form, my graphics are erased (just where the box was in the former case).
Do I have to detect these things and redraw, or is there a way to prevent this from happening?
Override your form's/control's 'OnPaint' method and perform the drawing
there.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
You must repaint by overriding the Form's Paint method.
"John Baker" <wb********@wzwfreivprf.pbz> wrote in message
news:nD***************@fe1.columbus.rr.com... I am using a Graphics object to draw on a form. If I pop up a message box, or if say the user minimizes and then restores the form, my graphics are erased (just where the box was in the former case).
Do I have to detect these things and redraw, or is there a way to prevent this from happening? -- To Email Me, ROT13 My Shown Email Address
John,
The Paint event (OnPaint method) is called each time you need to draw,
within the Paint event you want to use e.Graphics to do you drawing rather
then calling CreateGraphics directly. You do not need to displose of the
e.Graphics object, but you should dispose of other System.Drawing objects
that you may create.
The following article discusses the drawing on the form in more detail: http://www.bobpowell.net/creategraphics.htm
The above FAQ can be entered at: http://www.bobpowell.net/gdiplus_faq.htm
Hope this helps
Jay
"John Baker" <wb********@wzwfreivprf.pbz> wrote in message
news:nD***************@fe1.columbus.rr.com... I am using a Graphics object to draw on a form. If I pop up a message box, or if say the user minimizes and then restores the form, my graphics are erased (just where the box was in the former case).
Do I have to detect these things and redraw, or is there a way to prevent this from happening? -- To Email Me, ROT13 My Shown Email Address
"John Baker" <wb********@wzwfreivprf.pbz> wrote I am using a Graphics object to draw on a form. If I pop up a message box, or if say the user minimizes and then restores the form, my graphics are erased (just where the box was in the former case).
Do I have to detect these things and redraw, or is there a way to prevent this from happening?
That is the designed behaviour. For one way to keep the graphics
after minimizing, check out this link: http://groups.google.com/groups?selm...tngp13.phx.gbl
LFS This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Peter |
last post by:
I want to draw some lines on a widget.
This works ok, but when I want to redraw, the old lines are still there.
How do I clear or refresh the widget, so I can draw a new set of lines?
Code...
|
by: PHH |
last post by:
Help me, please,
When I redraw a ListviewItem in Listview (redraw items with icon and text
columms).
I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish
and run...
|
by: WHITETIGER |
last post by:
Help me, please,
When I redraw a ListviewItem in Listview (redraw items with icon and text
columms).
I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish
and run...
|
by: ch424 |
last post by:
Hi,
Does anybody know the fastest way to trigger a DrawingArea redaw in
pygtk? At the moment, I'm using a bit of a hack:
def redraw(self):
self.area.hide()
self.area.show()
Is there a...
|
by: kiplring |
last post by:
I wrote a program which draw a dancer at cornor of desktop. ( I
Accessed through hDC)
But It has a problem. I remains all trait at the desktop until I
invoke any Redraw( Refresh) action - click,...
|
by: CroDude |
last post by:
Hi all!
I've made a simple control derived from a panel class which draws gradient
in a overrided OnPaintBackground event.
Well, I know that I need to redraw control when it's resized by...
|
by: shrewdmonkey |
last post by:
Hi all,
I'm new to this .NET thing and I was wondering if there is any way to
make a splitter control redraw its affected controls while it is being
dragged as opposed to when the mouse button...
|
by: Nicolas |
last post by:
When I resize (Enlarge) the form while the progress bar is running the
rectangle drawing is not going to the end of the rectangle?
I got a form with one button, one statusbar with three...
|
by: Bob Steuernagel |
last post by:
This code is for a simple drawing program that lets the user draw lines,
rectangles, and circles in different colors. When the menu is dropped down
to change objects, it erases anything drawn...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |