vb 垂直滚动条定位
Sub TreeFill3(cTime As String, ByVal cKey As String)
Tree3.Nodes.Clear
' 循环填充tree1控件内容
Dim c As String
Dim cNode As Node
Dim cSql As String
Dim cRec As rdoResultset
Dim cRec1 As rdoResultset
Dim i As Integer
cSql = "SELECT cType_Name FROM tbl_Abs_Net WHERE cType='TYPE' AND iCount = 3"
Set cRec = gData.OpenResultset(cSql, rdOpenKeyset)
cRec.MoveFirst
i = 2
Do While cRec.EOF = False
c = Trim(cRec(0))
Set cNode = Tree3.Nodes.Add(, , , , i)
cNode.Key = "r" + Trim(cRec(0))
cNode.Text = c
cNode.Expanded = True '垂直滚动条起始位置在顶上
cSql = "SELECT A.iID,A.cTitle FROM tbl_Question A,tbl_Question_Oper O " _
& "WHERE A.iId=O.iID AND O.cOper_Code='" & gUserCode & "' AND A.cAnswer<>'' AND A.cType='" & c & "' " _
& " AND ((A.cTitle LIKE '%" & cKey & "%') OR (A.cQuestion LIKE '%" & cKey & "%') OR (A.cAnswer LIKE '%" & cKey & "%')) "
cSql = cSql + cTime + " ORDER BY A.iID Desc"
Set cRec1 = gData.OpenResultset(cSql, rdOpenKeyset)
If cRec1.RowCount <> 0 Then
Do While cRec1.EOF = False
c = Trim(CStr(cRec1(0))) + " " + Trim(cRec1(1))
Set cNode = Tree3.Nodes.Add("r" & Trim(cRec(0)), tvwChild, , , 1)
cNode.Text = c
cNode.Key = "d" & Trim(CStr(cRec1(0)))
' Tree3.Nodes("d" & Trim(cRec1(0))).EnsureVisible '垂直滚动条起始位置在底部
cRec1.MoveNext
Loop
End If
i = i + 1
cRec.MoveNext
Loop
cRec.Close
cRec1.Close
cNodeIndex1 = 1
End Sub
鼠标显示的形式: Screen.MousePointer = 11 显示为正在处理,实心圆圈
Tree3.Nodes.Clear
' 循环填充tree1控件内容
Dim c As String
Dim cNode As Node
Dim cSql As String
Dim cRec As rdoResultset
Dim cRec1 As rdoResultset
Dim i As Integer
cSql = "SELECT cType_Name FROM tbl_Abs_Net WHERE cType='TYPE' AND iCount = 3"
Set cRec = gData.OpenResultset(cSql, rdOpenKeyset)
cRec.MoveFirst
i = 2
Do While cRec.EOF = False
c = Trim(cRec(0))
Set cNode = Tree3.Nodes.Add(, , , , i)
cNode.Key = "r" + Trim(cRec(0))
cNode.Text = c
cNode.Expanded = True '垂直滚动条起始位置在顶上
cSql = "SELECT A.iID,A.cTitle FROM tbl_Question A,tbl_Question_Oper O " _
& "WHERE A.iId=O.iID AND O.cOper_Code='" & gUserCode & "' AND A.cAnswer<>'' AND A.cType='" & c & "' " _
& " AND ((A.cTitle LIKE '%" & cKey & "%') OR (A.cQuestion LIKE '%" & cKey & "%') OR (A.cAnswer LIKE '%" & cKey & "%')) "
cSql = cSql + cTime + " ORDER BY A.iID Desc"
Set cRec1 = gData.OpenResultset(cSql, rdOpenKeyset)
If cRec1.RowCount <> 0 Then
Do While cRec1.EOF = False
c = Trim(CStr(cRec1(0))) + " " + Trim(cRec1(1))
Set cNode = Tree3.Nodes.Add("r" & Trim(cRec(0)), tvwChild, , , 1)
cNode.Text = c
cNode.Key = "d" & Trim(CStr(cRec1(0)))
' Tree3.Nodes("d" & Trim(cRec1(0))).EnsureVisible '垂直滚动条起始位置在底部
cRec1.MoveNext
Loop
End If
i = i + 1
cRec.MoveNext
Loop
cRec.Close
cRec1.Close
cNodeIndex1 = 1
End Sub
鼠标显示的形式: Screen.MousePointer = 11 显示为正在处理,实心圆圈