FileListBox.Pattern 属性

定义

获取或设置一个值,该值指示运行时在 FileListBox 控件中显示的文件名。Gets or sets a value indicating the file names displayed in a FileListBox control at run time.

public:
 property System::String ^ Pattern { System::String ^ get(); void set(System::String ^ value); };
public string Pattern { get; set; }
member this.Pattern : string with get, set
Public Property Pattern As String

属性值

String

指示文件规范的字符串表达式,如 "*."。 *或 " * 。INLINE.FRM "。A string expression indicating a file specification, such as "*.*" or "*.FRM". 默认值为 " * . * ",这将返回所有文件的列表。The default is "*.*", which returns a list of all files.

注解

Pattern属性在设计应用程序的文件浏览和操作功能方面起着重要作用。The Pattern property plays a key role in designing an application's file-browsing and manipulation capabilities. Pattern 与其他文件控制属性结合使用,为用户提供浏览文件或类似文件组的方式。Use Pattern in combination with other file-control properties to give the user ways to explore files or groups of similar files. 例如,在专门用于启动其他程序的应用程序中,你可以指定仅 .exe 文件显示在 "文件" 列表框中 ( * .exe) 。For example, in an application dedicated to starting other programs, you could designate that only .exe files be displayed in the file list box (*.exe).

除了使用通配符以外,还可以使用以分号分隔的多种模式 (; ) 。In addition to using wildcard characters, you can also use multiple patterns separated by semicolons (;). 例如,"* .exe;* .bat "将返回所有可执行文件和所有 MS-DOS 批处理文件的列表。For example, "*.exe; *.bat" would return a list of all executable files and all MS-DOS batch files.

更改属性的值会 Pattern 生成一个 PatternChange 事件。Changing the value of the Pattern property generates a PatternChange event.

备注

Microsoft.VisualBasic.Compatibility.VB6 命名空间中的函数和对象用于工具从 Visual Basic 6.0 升级到 Visual Basic 2008。Functions and objects in the Microsoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic 2008. 多数情况下,这些函数和对象可再现 .NET Framework 中其他命名空间的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. 只有当 Visual Basic 6.0 代码模型与 .NET Framework 实现有显著区别时,才必须使用这些函数和对象。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

适用于