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

获得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 to the following syntax:
Private Declare Function SendMessage Lib "user32" _
   Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg _
   As Long, ByVal wParam As Long, lParam As Any) As Long
Since
we want to gather the listbox: selected items, we'll send the
LB_GETSELITEMS constant in the wMsg argument, which you declare like so:
Private Const LB_GETSELITEMS = &H191
The LB_GETSELITEMS message fills an array with the index numbers of all the selected items.
Dim ItemIndexes() As Long, x As Integer, iNumItems As Integer
iNumItems = ThisBox.SelCount
If iNumItems Then
   ReDim ItemIndexes(iNumItems - 1)
   SendMessage ListBox1.hwnd, LB_GETSELITEMS, iNumItems, ItemIndexes(0)
End If
For x = 0 To iNumItems - 1
   MsgBox ListBox1.List(ItemIndexes(x)) '弹出对话框
Next x
After
being passed to the SendMessage function, iNumItems holds the total
number of selected items, and the ItemIndexes array holds the selected
item index values. Notice, that you must pass a pointer to the
ItemIndexes array, and not the array itself. Thus, we passed
ItemIndexes(0) into the SendMessage function, not ItemIndexes().


相关文档:

VB复制文件夹的方法(非FSO)

http://www.webuc.net/ddf3/archive/2005/08/25/6142.aspx
不用FSO的复制文件夹得方法?
用API函数 SHFileOperation
以下是使用SHFileOperation删除复制移动文件的例子,可以复制文件夹
Private Type SHFILEOPSTRUCT
  hwnd As Long
  wFunc As Long
  pfrom As String
  pTo As String
  fFlags As ......

vb 保存图片到数据库

'读数据到二进制字段
Public Sub ReadfromBLOB(filed As ADODB.Field, Filen As String)
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer
'传送块单位大小
Const ChunkSize As Integer = 16384
Dim MediaTemp As String
Dim lngOffset As Long
Di ......

vb 转 C#

http://www.tangiblesoftwaresolutions.com/Product_Details/Instant_CSharp.html
http://www.tangiblesoftwaresolutions.com/?gclid=COeGzKKxo58CFQIupAodu2jvJQ
在线
VB.net和C#在线互转工具
http://bbs.51aspx.com/showtopic-2059.html
Convert VB.NET to C#
http://www.developerfusion.com/tools/convert/vb-to- ......

.net中用DropDownList选择日期(vb代码)

看了别人写的C#的 自己转了一下 然后后重新改了改 写成了这个
另外还有一个我写的验证日期是否合法的代码 在后面 都是vb的 c#只会看不会写
  '判断闰年=======================
Private Function CheckLeap(ByVal year As Integer) As Boolean
If (year Mod 4 = 0) AndAlso (year Mod 100 <> ......

[VB]GDI+ IStream、StdPicture、Byte() 互转

很多年前就想做一个远程控制的软件,只是一直以来图片的压缩速度总是提升不上去,而我也参考过很多网上的关于图片压缩的例子,比如zyl910的GIF_LZW压缩方法,Huffman压缩方法,以至到GDI+的直接生成JPG、PNG的方法(这种方法无论从压缩率和速度上都是最佳的,可惜这种方法网上一直没找到直接保存为Byte()的例子,见得最多的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号