原创 MFC文件对话框中文件滤波器

2009-1-13 20:20 2585 7 7 分类: 软件与OS
FileDialog.setFilter

FileDialog.setFilter



Sets the current filter string (the string that determines the choices that
appear in the Save as file type or Files of type box in the dialog
box and allow the user to filter out the kinds of files that are shown in the
dialog box).


Syntax


public final void setFilter( String value
)


Parameters


value


A string that contains information about all the available file
filters in the dialog box. For each filter, the filter string contains a
description of the filter, followed by the vertical bar (|), followed by the
filter pattern. The strings for different filters are separated by the "|"
character. The following is an example of a filter string: "Text files
(*.txt)|*.txt|All files (*.*)|*.*" To specify multiple filter patterns for a
single filter, use a semicolon to separate the patterns (for example,
"*.txt;*.doc;*.bak"). A pattern string can be a combination of valid file name
characters and the asterisk (*) wildcard character. Do not include spaces in the
pattern string. Filters are displayed in the dialog box in the order they are
specified in the value parameter to the setFilter property.


Remarks

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
7
关闭 站长推荐上一条 /3 下一条