By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,162 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,162 IT Pros & Developers. It's quick & easy.

Form update

P: n/a
J L
I am removing and adding picture boxes on a form. I would like to have
the old image form remain until I have completed the changes. Is that
possible? As it is now, the form appears to blink as I remove the old
images and add the new ones. And the set of images displayed is not
the same from one state to the next. So I delete all the old ones
first (effectively clearing the screen) before adding the new ones.

Hope that makes sense,
TIA,
John
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
JL,

You need to set them than first in there own bitmaps.

Now you have probably something as picturecox.imagefromfile

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
"J L" <jo**@marymonte.com> schrieb:
I am removing and adding picture boxes on a form. I would like to have
the old image form remain until I have completed the changes. Is that
possible? As it is now, the form appears to blink as I remove the old
images and add the new ones. And the set of images displayed is not
the same from one state to the next. So I delete all the old ones
first (effectively clearing the screen) before adding the new ones.

Take a look at 'Control.SuspendLayout' and 'Control.ResumeLayout' for
suspending layouting.

If you want to prevent a control from redrawing, take a look at the article
below:

Preventing controls from redrawing
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=disableredrawing&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
J L
Hi Herfried
I thought SuspendLayout and ResumeLayout would be what I need. But it
appears that if you use this on a form, the underlying controls still
draw themselves in sequence once you resume layout.

What I did was wrap my code in me.SuspendLayout and me.ResumeLayout. I
then did a loop and removed all of the picture boxes on the form and
then a second loop and added them back. The screen blinked blank
showing I had removed the picture boxes and then displayed them.

Am I missing something?

TIA,
John

On Thu, 5 May 2005 10:18:31 +0200, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"J L" <jo**@marymonte.com> schrieb:
I am removing and adding picture boxes on a form. I would like to have
the old image form remain until I have completed the changes. Is that
possible? As it is now, the form appears to blink as I remove the old
images and add the new ones. And the set of images displayed is not
the same from one state to the next. So I delete all the old ones
first (effectively clearing the screen) before adding the new ones.

Take a look at 'Control.SuspendLayout' and 'Control.ResumeLayout' for
suspending layouting.

If you want to prevent a control from redrawing, take a look at the article
below:

Preventing controls from redrawing
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=disableredrawing&lang=en>


Nov 21 '05 #4

P: n/a
"J L" <jo**@marymonte.com> schrieb:
I thought SuspendLayout and ResumeLayout would be what I need. But it
appears that if you use this on a form, the underlying controls still
draw themselves in sequence once you resume layout.

What I did was wrap my code in me.SuspendLayout and me.ResumeLayout. I
then did a loop and removed all of the picture boxes on the form and
then a second loop and added them back. The screen blinked blank
showing I had removed the picture boxes and then displayed them.

Am I missing something?


Did you take a look at the 2nd solution I included in my post?

'SuspendLayout' will only disable layout logic, which includes docking and
anchoring for controls. It won't prevent them from being redrawn.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

P: n/a
J L
OMG! That works prefectly. How do you know all this STUFF!! LOL

Thank you very very much. Also one note to those that are interested,
be sure to put the code that redraws and refreshes in a Finally clause
or you can get hosed.

John

On Thu, 5 May 2005 17:16:38 +0200, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"J L" <jo**@marymonte.com> schrieb:
I thought SuspendLayout and ResumeLayout would be what I need. But it
appears that if you use this on a form, the underlying controls still
draw themselves in sequence once you resume layout.

What I did was wrap my code in me.SuspendLayout and me.ResumeLayout. I
then did a loop and removed all of the picture boxes on the form and
then a second loop and added them back. The screen blinked blank
showing I had removed the picture boxes and then displayed them.

Am I missing something?


Did you take a look at the 2nd solution I included in my post?

'SuspendLayout' will only disable layout logic, which includes docking and
anchoring for controls. It won't prevent them from being redrawn.


Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.