第一个If语句能执行成功,为什么后两个不执行?(点击按钮时,选择哪个节点就显示相应内容)
本帖最后由 bcrun 于 2012-11-18 12:40:19 编辑 代码如下:第一个If语句能执行成功,为什么后两个不执行?(点击按钮时,选择哪个节点就显示相应内容)
If TreeView1.Nodes.Count > 0 Then
Select Case TreeView1.SelectedItem
Case "单选题"
Text1.Text = "信息单选题"
Case "多选题"
Text1.Text = "信息多选题"
Case "判断题"
Text1.Text = "信息判断题"
End Select
Else
If TreeView2.Nodes.Count > 0 Then
Select Case TreeView2.SelectedItem
Case "单选题"
Text1.Text = "Word单选题"
Case "多选题"
Text1.Text = "Word多选题"
Case "判断题"
Text1.Text = "Word判断题"
End Select
Else
If TreeView3.Nodes.Count > 0 Then
Select Case TreeView3.SelectedItem
Case "单选题"
Text1.Text = "Excel单选题"
Case "多选题"
Text1.Text = "Excel多选题"
Case "判断题"
Text1.Text = "Excel判断题"
End Select
End If
End If
End If
If TreeView1.Nodes.Count > 0 Then
Select Case TreeView1.SelectedItem
Case "单选题"
Text1.Text = "信息单选题"
Case "多选题"
Text1.Text = "信息多选题"
Case "判断题"
Text1.Text = "信息判断题"
End Select
endif
If TreeView2.Nodes.Count > 0 Then
Select Case TreeView2.SelectedItem
Case "单选题"
Text1.Text = "Word单选题"
Case "多选题"
Text1.Text = "Word多选题"
Case "判断题"
Text1.Text = "Word判断题"
End Select
end if
If TreeView3.Nodes.Count > 0 Then
Select Case TreeView3.SelectedItem
Case "单选题"
Text1.Text = "Excel单选题"
Case "多选题"
Text1.Text = "Excel多选题"
Case "判断题"
Text1.Text = "Excel判断题"
End Select
End If
If TreeView1.Nodes.Count > 0 Then
Select Case TreeView1.SelectedItem
Case "单选题"
Text1.Text = "信息单选题"
Case "多选题"
Text1.Text = "信息多选题"
Case "判断题"
Text1.Text = "信息判断题"
End Select
Else If TreeView2.Nodes.Count > 0 Then
Select Case TreeView2.SelectedItem
Case "单选题"
Text1.Text = "Word单选题"
Case "多选题"
Text1.Text = "Word多选题"
Case "判断题"
Text1.Text = "Word判断题"
End Select
Else If TreeView3.Nodes.Count > 0 Then
Select Case TreeView3.SelectedItem
Case "单选题"
Text1.Text = "Excel单选题"
Case "多选题"
Text1.Text = "Excel多选题"
Case "判断题"
Text1.Text = "Excel判断题"
End Select
End If