?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5460
ClientLeft = 60
ClientTop = 345
ClientWidth = 6105
LinkTopic = "Form1"
ScaleHeight = 5460
ScaleWidth = 6105
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox List1
Height = 3120
Left = 0
TabIndex = 0
Top = 0
Width = 4695
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
'----------------------By 陳銳------------------------------
'如果你要在Internet或BBS上轉(zhuǎn)貼文章,請通知我知道
'Email: blackcat@nease.net develope@163.net
'請參觀我的站點(diǎn) http://www.nease.net/~blackcat
'這個程序演示如何給List Box的每個列表行加上不同的提示行
'運(yùn)行該程序,當(dāng)鼠標(biāo)移動到任一行上后,彈出的ToolTip就會提示該行的完整內(nèi)容
'
Option Explicit
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
Private Const LB_ITEMFROMPOINT = &H1A9
Private Sub Form_Load()
With List1
.AddItem "陳銳 ChenReee@Netaddress.com"
.AddItem "陳銳 Reee-Chen@Netaddress.com"
.AddItem "陳銳 Chenrui@hotmail.com"
End With
End Sub
Private Sub List1_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
'
' present related tip message
'
Dim lXPoint As Long
Dim lYPoint As Long
Dim lIndex As Long
'
If Button = 0 Then ' 如果沒有按鈕被按下
lXPoint = CLng(X / Screen.TwipsPerPixelX)
lYPoint = CLng(Y / Screen.TwipsPerPixelY)
With List1
' 獲得當(dāng)前的光標(biāo)所在的的屏幕位置確定標(biāo)題位置
lIndex = SendMessage(.hwnd, LB_ITEMFROMPOINT, 0, _
ByVal ((lYPoint * 65536) + lXPoint))
' 顯示提示行或清除提示行
If (lIndex >= 0) And (lIndex <= .ListCount) Then
Else
.ToolTipText = ""
End If
End With
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -