易截截图软件、单文件、免安装、纯绿色、仅160KB

VB中删除数组重复元素

Option Explicit
Function Delete3(Arr As Variant) As Variant
Dim i As Integer
For i = LBound(Arr) To UBound(Arr)
If i > UBound(Arr) Then Exit For
If Arr(i) = 3 Then
Do
Dim j As Integer
For j = i To UBound(Arr) - 1
Arr(j) = Arr(j + 1)
Next j
If LBound(Arr) = UBound(Arr) Then
Delete3 = Empty
Exit Function
End If
ReDim Preserve Arr(LBound(Arr) To UBound(Arr) - 1)
If i > UBound(Arr) Then Exit For
Loop While Arr(i) = 3
End If
Next i
Delete3 = Arr
End Function
Sub Test()
Delete3 (Array(3, 3, 3, 3, 1, 3, 7, 3, 3, 3, 9, 3, 3))
Delete3 (Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3))
Delete3 (Array(1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3))
Delete3 (Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1))
End Sub


相关文档:

VB.NET+AJAX搜索建议功能的实现

IDE:Visual Web Developer 2008 Express Edition
数据库:Access 2007
到http://www.asp.net/ajax/downloads/下载AJAX Control Toolkit,将AjaxControlToolkit.dll拷贝到项目的bin目录下,在工具栏中引入。
WebService的代码:(aaa.asmx)
Public Function GetCompletionList(ByVal prefixText As String, ByVal coun ......

VB中播放WAV文件

http://zhidao.baidu.com/question/33440250.html
在模块中输入以下代码
Public Declare Function sndPlaySound Lib "winmm" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
' flag uitzetten
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1 ......

VB如何生成WINDOW XP风格界面!

 虽然WindowsXP的界面非常华丽。但是令人遗憾的是,我们用VB写的程序除了菜单和窗口的外观是XP风格外,其他控件还是一如既往的是普通风格。我想,有的程序在XP下有XP的风格,VB也一定有办法实现XP的风格。后来笔者在网上看到一篇介绍XML的文章,又在网上找到了一篇实现XP风格的文章,经过自己的实践,终于找到了VB程序 ......

获得VB listbox 选中项目(多项)的一个好方法

传统方法是遍历一遍
如果listbox 项目过多
明显速度不行
好方法是通过sendmessge发消息给listbox让他把选中项目直接传到参数数组中
You can use the SendMessage() API function instead.
As
you probably know, this function lets you send a message to one or more
windows. The declaration statement conforms ......

重拾VB之二,毫秒篇

重拾VB之二,毫秒篇
PMP 关劲松
   
    鬼使神差,09年12月入职的公司仍使用VB开发软件,虽然并非专职开发,但也不得不在事隔4年之后,重新使用VB。
    在vb中如何获得毫秒精度级别的时间?vb的时间函数不支持毫秒,需要利用windows的基本API,编写程序才能获取毫秒级 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号