Wrox Programmer Forums
|
Visual Basic 2010 General Discussion For any discussions about Visual Basic 2010 topics which aren't related to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2010 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2011, 12:34 PM
Registered User
 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Graphics Re-Paint Problem

I have a Form with a PictureBox component on which I draw a coloured Piechart. My Problem is that I can get the Piechart to re -Paint if the Form is dragged smaller so that part of the PieChart is covered and opened out again and also if the form is covered partly by another form and uncovered again. However if I minimize the form and then maximize it again the PictureBox and the Piechart briefly re-paint and then are immediately obscured by the Form re-painting itself. Can anyone explain what I am doing wrong and how to overcome the problem ?
 
Old January 3rd, 2011, 12:41 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Just simple call the refresh property of the picture box!

You can call it in any event of the form events, in fact you can call it any where. So when the you maximise the form look at that form event.
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old January 5th, 2011, 12:48 PM
Registered User
 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Graphics Re-Paint Problem

Thanks for advice but I cannot seem to find the maximize event details and there is no 'Refresh' property in the Visual Studio 2010 property list so I am no nearer.
 
Old January 6th, 2011, 05:29 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Wink

Code:
Private Sub Form1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus
        PictureBox1.Refresh()
End Sub
Jobs a good 'un
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old January 8th, 2011, 11:58 AM
Registered User
 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Graphicas Re-Paint Problem

Again thanks for your suggestions which I have tried without any success. I tried everything that I thought might be happening when on one re-opens the form from minimized such as ResizeEnd, MaximizeEnd etc all without success. However I then tried some experiments on a simple Form with first a PictureBox with no success so I then thought I will try changing the PictureBox for a Panel and 'voila' - it worked so I went back to my original program and changed to a Panel for the PictureBox in there and now every thing works fine. The form minimizes and resizes and the graphics re-paint themselves immediately.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Graphics resorces Israr ASP.NET 1.0 and 1.1 Professional 0 December 19th, 2006 01:50 AM
Graphics problem cassius_b C# 1 July 25th, 2006 10:29 PM
How do I paint a point onto th form alan2here Visual C++ 2005 0 April 4th, 2006 01:42 PM
BGI graphics problem in turbo c++ 4.5 mrafaqi C++ Programming 1 October 12th, 2003 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.