vb combo1和list1的问题

来源:百度知道 编辑:UC知道 时间:2024/06/23 02:08:16
用vb编个程序,有combo1和list1两个控件,combo1里是“第一项”、“第二项”、“第三项”三项,目的是当选择combo1里的“第一项”时,list1里显示“111”、“222”、“333”,当选择combo1里的“第二项”时,list1里显示“222”、“333”、“111”,当选择combo1里的“第三项”时,list1里显示“333”、“111”、“222”,list1里的内容竖向排列,请教高手如何实现?

新建一个文本文档,将下面代码复制到新建的文本文档里面,修改文本文档名字为:form1.frm,然后用vb6.0编译器打开,运行之。。。

VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5025
ClientLeft = 60
ClientTop = 450
ClientWidth = 6990
LinkTopic = "Form1"
ScaleHeight = 5025
ScaleWidth = 6990
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo1
Height = 300
Left = 960
TabIndex = 1
Text = "Combo1"
Top = 840
Width = 2535
End
Begin VB.ListBox List1
Height = 3480
Left = 4680
TabIndex = 0
Top = 720
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Combo1_Click()
Select Case Combo1.Text
Case "第一项"
L