VB,combobox,为何打开窗体时,click事件可以触发,而change事件不能触发?
PrivateSubcmbKind_Click()File1.Pattern=cmbKind.Text放在click事件,filelistbox能实现筛选,而放chang...
Private Sub cmbKind_Click()
File1.Pattern = cmbKind.Text 放在click事件,filelistbox能实现筛选,而放change则不能筛选,为何?
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
txtFile = File1.FileName
End Sub
Private Sub Form_Load()
'初始化文件类型列表
With cmbKind
.Text = ""
.AddItem "*.exe"
.AddItem "*.doc"
.AddItem "*.xls"
.AddItem "*.mp3"
.ListIndex = 0
End With
End Sub 展开
File1.Pattern = cmbKind.Text 放在click事件,filelistbox能实现筛选,而放change则不能筛选,为何?
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
txtFile = File1.FileName
End Sub
Private Sub Form_Load()
'初始化文件类型列表
With cmbKind
.Text = ""
.AddItem "*.exe"
.AddItem "*.doc"
.AddItem "*.xls"
.AddItem "*.mp3"
.ListIndex = 0
End With
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询