简单VB程序求解,谢谢
控件有:list2 command1
list2 中的内容
List2.AddItem "123456“
List2.AddItem "456789“
List2.AddItem "789123“
选中123456,command1打开网站一
选中456789,command1打开网站二
选中789123,command1打开网站三
如何操作呢?详细代码!
答案:Private Sub List2_Click()
Select Case List2.Text
Case "123456"
Shell "explorer.exe www.网站1.com"
Case "456789"
Shell "explorer.exe www.网站2.com"
Case "789123"
Shell "explorer.exe www.网站3.com"
End Select
End Sub
其他:Dim strURL(3) As String
Private Sub Command1_Click()
If List2.ListIndex >= 0 Then
Shell "C:\Program Files\Internet Explorer\iexplore.exe " & strURL(List2.ListIndex + 1)
End If
End Sub
Private Sub Form_Load()
List2.AddItem "123456"
List2.AddItem "456789"
List2.AddItem "789123"
strURL(1) = "http://www.zhaoxi.net" '网站1
strURL(2) = "http://www.xiaoyaxiao.com" '网站2
strURL(3) = "http://www.sina.com.cn" '网站3
End Sub
上一个:学VB的进来,大家帮我分析下,我下面的程序什么意思,真心谢谢了~下面是用定时器实现字幕移动
下一个:用VB做时钟