# 怎样让移动图像显示更快一些...

## Hide Controls When Setting Properties to Avoid Multiple Repaints

Every repaint is expensive. The fewer repaints Visual Basic must perform, the faster your application will appear. One way to reduce the number of repaints is to make controls invisible while you are manipulating them. For example, suppose you want to resize several list boxes in the Resize event for the form:

Sub Form_Resize ()Dim i As Integer, sHeight As Integer   sHeight = ScaleHeight / 4   For i = 0 To 3      lstDisplay(i).Move 0, i * sHeight, _      ScaleWidth, sHeight   NextEnd Sub

This creates four separate repaints, one for each list box. You can reduce the number of repaints by placing all the list boxes within a picture box, and hiding the picture box before you move and size the list boxes. Then, when you make the picture box visible again, all of

the list boxes are painted in a single pass:

## 在vb中用move方法移动图片时,速度有些慢,当图片很大时,这时可以用下面的方法:

Sub Form_Resize ()Dim i As Integer, sHeight As Integer   picContainer.Visible = False   picContainer.Move 0, 0, ScaleWidth, ScaleHeight   sHeight = ScaleHeight / 4   For i = 0 To 3      lstDisplay(i).Move 0, i * sHeight, _      ScaleWidth, sHeight   Next   picContainer.Visible = TrueEnd Sub

Note that this example uses the Move method instead of setting the Top and Left properties. The Move method sets both properties in a single operation, saving additional repaints.

#### Windows xp最实用的技巧，让你的电脑运行更快。

2014-04-27 11:55:17

#### 电脑变慢怎么让电脑变快，教你从软硬件 两方面搞定

2008-07-21 14:31:00

#### eclipse 如何让eclipse启动更快

2015-12-06 22:23:19

#### 如何让你的网站显示速度更快

2016-05-16 13:05:41

#### 如何让程序运行更快时间更短C语言代码(程序员必看)

2012-01-14 20:25:36

#### 【tomcat】怎么让tomcat启动变快 tomcat启动快方法

2017-03-13 21:57:55

#### Android之如何让Android studio编译更快

2017-04-19 20:58:58

#### 在移动网络上创建更稳定的连接

2015-06-18 11:08:21

#### 让Oracle跑得更快1 性能与优化思路_文字版_非扫描版

2016年09月11日 3.12MB 下载

#### 让Oracle跑得更快.pdf

2017年05月05日 48.12MB 下载