文件名称:编写代码-OCX制作开发
文件大小:377KB
文件格式:PPT
更新时间:2024-05-15 03:18:45
OCX ActiveX VB控件
3.编写代码 Private Sub Drive1_Change() ' 当在驱动器列表框选择新的驱动器时 Dir1.Path = Drive1.Drive ' 目录列表框的路径改变 End Sub Private Sub Dir1_Change() ' 目录列表框的路径改变时 File1.Path = Dir1.Path ' 文件列表框的路径改变 End Sub Private Sub Combo1_Click() File1.Pattern = Trim(Right(Combo1.Text, 5)) '文件类型为列表框的后5个字符 End Sub Private Sub File1_Click() Picture1.Picture = LoadPicture(File1.Path + "\" + File1.FileName) End Sub Private Sub UserControl_Initialize() File1.Pattern = "*.bmp;*.tif;*.tiff;*.jmp;*.jpg;*.jpeg;*.gif" End Sub