|
Private Sub rmTreeView1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
Dim mNode As Node
Dim NodeID As String
Dim strCode() As String
Dim strSQL As String
Dim rst As DAO.Recordset
Set mNode = rmTreeView1.SelectedItem
strCode = Split(mNode.Key, "_")
If blNodeClick Then
If Button = 2 Then
iSQLs = ""
Application.CommandBars("menuTreeView").Controls(2).Enabled = _
IIf(mNode.Children = 0 And Not mNode.Parent Is Nothing, True, False)
Application.CommandBars("menuTreeView").Controls(4).Enabled = IIf(mNode.Children = 0, False, True)
Application.CommandBars("menuTreeView").ShowPopup
Select Case UCase(iSQLs)
Case "ADD"
popupAdd
Case "DEL"
popupDel
Case "MOD"
mNodeText = mNode.Text
Me.rmTreeView1.StartLabelEdit
Case "SORT"
mNode.Sorted = True
End Select
End If
End If
blNodeClick = False
End Sub
上面是一段tree的程序,当右键单击的时候可以进行添加、修改和删除。为了防止别人误删,想在执行这几个命令前要求输入密码,密码正确才可以进行添加、修改和删除。
哪位大虾能教教我怎么做????拜谢 |
|