驱动器列表:DriveListBox Drive1.Drive = "X" 设置X驱动器的起始驱动器 目录列表框控件:DirListBox Dir1.Path = "E:\KuGou" 设置目录列表框的默认路径 文件列表框:FileListBox 一般DriveListBox和DirListBox结合使用,他们各自的代码为: Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub
Private Sub Drive1_Change() Dir1.Path = Drive1.Drive End Sub
公共对话框控件: CommonDialog1.Action = 1或CommonDialog1.ShowOpen都可以打开对话框 CommonDialog1的属性: .FileName 文件名称和路径;.FileTitle 文件名;.Filter 设置打开文件的类型 Private Sub Command1_Click() Dim str1 As String CommonDialog1.Filter = "文本文件(*.txt)|*.txt" CommonDialog1.ShowOpen Open CommonDialog1.FileName For Input As #1 Line Input #1, str1 Close 1 Form1.Print str1 End Sub
Flags属性设置字体对话框 Text.MultiLine是否允许多行输入,属性设置为true后,在文本框中可以进行换行,还可以结合scrollbars属性,设置其滚动条样式。只有 multiline 属性为真才能使滚动条属性scrollbor起作用 ,文本框的多行显示,如果你scrollbars属性设置为TRUE的话,multiline肯定要是TRUE
阅读(1481)|
评论(3)
|
喜欢
推荐
转载
|
|
来自: 昵称19016448 > 《vb》