VB MSHFLEXGRID MSHFLEXGRID 同时选中不连续的多行
在工程中添加一个类模块,名为 Selection
然后加入以下代码:
Dim colRows As Collection
Dim ControlKey As Boolean
Public WithEvents flx As MSFlexGrid
Public Sub ToggleSelection()
Dim x As Integer
Dim d
Dim mode As Boolean
Dim OldRow, OldCol
x = flx.Row
If x = 0 Then Exit Sub
On Error Resume Next
OldRow = flx.Row
OldCol = flx.col
d = colRows(CStr(x))
If Err Then ' not add
colRows.Add x, CStr(x)
mode = True
Else
colRows.Remove CStr(x) 'remove
mode = False
End If
MakeSelectedStatus x, mode
相关文档:
如何让幻灯片在vb的框架里播放
'Microsoft PowerPoint 9.0(Office 2000的,如果是97则是8.0) Object Library)
''Microsoft PowerPoint 11.0(Office 2003) Object Library)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '延时API声明
Private Sub Form_Load()
Dim ppt As New PowerPoint. ......
VB编写托盘图标有两个要点,一是使用 Shell_NotifyIcon 函数显示图标;二是向系统注册 TaskbarCreated 消息,以便explorer崩溃时恢复托盘的图标。
首先需要增加一个模块文件,内容如下:
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOT ......
VB学的用的都不精,编个程序用了很长时间了,现在这个通讯部分还没做好,求助大家一下:
ctrMSComm.Output = "@01R" '读命令
instar = ctrMSComm.Input '读通讯
wy_I = val(HEX_to_DEC(Mid(instar, 29, 4))) * (20 / 4095#)
&n ......
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Dim Url As String, Filepath As String
Url = "h ......
VB6
在程序运行时用如下语句:
if app.PrevInstance=true then
end
end if
VB 2005:
1. 在VB2005中,打开"属性"页,启用"应用程序“框架, 选中"
单实例应用程序"前面复选框,就行了。
......