⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qqexp029.html

📁 包含大量VB常用函数 大概一百几十个左右 每个函数都有比较详细的说明 希望大家喜欢它啦
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html">
<meta name="Generator" content="千千VB站 VB函数清单">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>千千VB站 VB函数清单</title>
</head>

<body text="#000000" bgcolor="#FFFFFF" link="#2020A0" vlink="#FF0000" alink="#FF0000">

<marquee><b><blink><font color="#000000">处理其它事件</font></blink></b></marquee>
<center>
<hr width="100%" szie="4">
</center>
<p>&nbsp;&nbsp;&nbsp; 
处理其它事件是什么呢?顾名思意,就是先行处理程序里其它正在发生的事件,当程序陷入回圈时,整个程序都会停在处理回圈上,当回圈尚未被处理结束,程序便一直被停摆,在这个时间内而有其它事件发生时,VB会视而不见,为了解决这个麻烦的问题,DoEvents便是因此而但生。
<p>EX:<br>
<font color="#0000FF">For</font> N = 1 To 100000<br>
&nbsp;&nbsp;&nbsp; Me.Caption = N<br>
<font color="#0000FF">Next</font><br>
按程序的流程来说,Me.Caption的内容会依序由1开始显示到100000,可是事时上程序却停顿一会,并直接跳到显示100000,这并不是电脑速度很快的缘故,而是VB正忙於For 
... Next ...回圈,而不处理其它正在发生的事件。为了解决这个问题,DoEvents函式就要上场了。<br>
<font color="#0000FF">For</font> N = 1 To 100000<br>
&nbsp;&nbsp;&nbsp; Me.Caption = N<br>
&nbsp;&nbsp;&nbsp; DoEvents<br>
<font color="#0000FF">Next</font>
<p>还有一例:<br>
<font color="#0000FF">Open</font> &quot;stupids.txt&quot; For <font color="#0000FF">Input 
As</font> #1<br>
&nbsp;&nbsp;&nbsp; <font color="#0000FF">Do Until</font> EOF(1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Line <font color="#0000FF">Input</font> 
#1,MyStr<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text1.Text = Text1.Text + MyStr + 
vbCrlf<br>
&nbsp;&nbsp;&nbsp; <font color="#0000FF">Loop</font><br>
Close #1<br>
照理说可以看到文字一段一段被放入TextBox,可是结果也是停顿一段时间後,整个TextBox就会突然出现所有的文字。姐决方法就是加入DoEvents。<br>
<font color="#0000FF">Open</font> &quot;stupids.txt&quot; For <font color="#0000FF">Input 
As</font> #1<br>
&nbsp;&nbsp;&nbsp; <font color="#0000FF">Do Until</font> EOF(1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Line <font color="#0000FF">Input</font> 
#1,MyStr<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text1.Text = Text1.Text + MyStr + 
vbCrlf<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoEvents<br>
&nbsp;&nbsp;&nbsp; <font color="#0000FF">Loop</font><br>
Close #1

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -