SpecialFolder new item:
MyNetwork = 0x12,
FileDialog design Changes:
FileDialog.MinimumSize = new Size(600, 420);
FileDialog member changes:
private static Padding FileViewPadding = new Padding(96, 28, 5, 53);
private bool m_DesktopOnly;
private bool m_FolderSelect;
private bool m_HideSpecialFolders;
private IntPtr m_myNetPidl;
private string m_myNetPath;
private string m_myNetName;
private IntPtr m_recentPidl;
private string m_recentPath;
private string m_recentName;
FileDialog method changes:
FileDialog.Init() changes:
private void Init()
{
NativeMethods.SHFILEINFO info;
info = new NativeMethods.SHFILEINFO();
NativeMethods.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, (int)SpecialFolder.MyComputer,
out m_myCompPidl);
NativeMethods.Shell32.SHGetFileInfo(m_myCompPidl, 0, ref info, NativeMethods.cbFileInfo,
NativeMethods.SHGFI_PIDL | NativeMethods.SHGFI_DISPLAYNAME);
m_myCompName = info.szDisplayName;
info = new NativeMethods.SHFILEINFO();
NativeMethods.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, (int)SpecialFolder.MyNetwork,
out m_myNetPidl);
NativeMethods.Shell32.SHGetFileInfo(m_myNetPidl, 0, ref info, NativeMethods.cbFileInfo,
NativeMethods.SHGFI_PIDL | NativeMethods.SHGFI_DISPLAYNAME);
m_myNetName = info.szDisplayName;
info = new NativeMethods.SHFILEINFO();
NativeMethods.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, (int)SpecialFolder.Recent,
out m_recentPidl);
NativeMethods.Shell32.SHGetFileInfo(m_recentPidl, 0, ref info, NativeMethods.cbFileInfo,
NativeMethods.SHGFI_PIDL | NativeMethods.SHGFI_DISPLAYNAME);
m_recentName = info.szDisplayName;
NativeMethods.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, (int)SpecialFolder.Desktop, out m_desktopPidl);
IntPtr desktopFolderPtr;
NativeMethods.Shell32.SHGetDesktopFolder(out desktopFolderPtr);
m_desktopFolder = (NativeMethods.IShellFolder)Marshal.GetObjectForIUnknown(desktopFolderPtr);
m_desktopPath = GetDisplayName(m_desktopFolder, m_desktopPidl, NativeMethods.SHGNO.SHGDN_FORPARSING);
m_currentFolder = m_desktopFolder;
NativeMethods.SHGFAO pdwAttributes = 0;
m_desktopFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, NativeMethods.CLSID_MyDocuments, IntPtr.Zero,
out m_myDocsPidl, pdwAttributes);
info = new NativeMethods.SHFILEINFO();
NativeMethods.Shell32.SHGetFileInfo(m_myDocsPidl, 0, ref info, NativeMethods.cbFileInfo,
NativeMethods.SHGFI_PIDL | NativeMethods.SHGFI_DISPLAYNAME);
m_myDocsName = info.szDisplayName;
m_myDocsPath = GetDisplayName(m_desktopFolder, m_myDocsPidl, NativeMethods.SHGNO.SHGDN_FORPARSING);
m_myNetPath = GetDisplayName(m_desktopFolder, m_myNetPidl, NativeMethods.SHGNO.SHGDN_FORPARSING);
m_recentPath = GetDisplayName(m_desktopFolder, m_recentPidl, NativeMethods.SHGNO.SHGDN_FORPARSING);
}
FileDialog.InitPlacesBar() changes:
private void InitPlacesBar()
{
int lineLimit = 13;
ToolStripButton recentDocumentsButton = new ToolStripButton(ShellImageList.GetImage(SpecialFolder.Recent));
recentDocumentsButton.Tag = m_recentPidl;
recentDocumentsButton.Text = this.InsertLineBreaks(m_recentName, lineLimit);
placesBar.Items.Add(recentDocumentsButton);
ToolStripButton desktopButton = new ToolStripButton(ShellImageList.GetImage(SpecialFolder.Desktop));
desktopButton.Tag = m_desktopPidl;
desktopButton.Text = this.InsertLineBreaks(GetDisplayName(m_desktopFolder, m_desktopPidl, NativeMethods.SHGNO.SHGDN_INFOLDER), lineLimit);
placesBar.Items.Add(desktopButton);
ToolStripButton myDocsButton = new ToolStripButton(ShellImageList.GetImage(SpecialFolder.MyDocuments));
myDocsButton.Tag = m_myDocsPidl;
myDocsButton.Text = this.InsertLineBreaks(m_myDocsName, lineLimit);
placesBar.Items.Add(myDocsButton);
ToolStripButton myCompButton = new ToolStripButton(ShellImageList.GetImage(SpecialFolder.MyComputer));
myCompButton.Tag = m_myCompPidl;
myCompButton.Text = this.InsertLineBreaks(m_myCompName, lineLimit);
placesBar.Items.Add(myCompButton);
ToolStripButton myNetButton = new ToolStripButton(ShellImageList.GetImage(SpecialFolder.MyNetwork));
myNetButton.Tag = m_myNetPidl;
myNetButton.Text = this.InsertLineBreaks(m_myNetName, lineLimit);
placesBar.Items.Add(myNetButton);
foreach (ToolStripItem placeItem in placesBar.Items)
{
placeItem.Margin = new Padding(1, 0, 0, 0);
placeItem.Padding = new Padding(0, 8, 0, 8);
placeItem.ImageAlign = ContentAlignment.BottomCenter;
placeItem.TextImageRelation = TextImageRelation.ImageAboveText;
}
}
private string InsertLineBreaks(string text, int lineLimit)
{
string[] splitText = text.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
text = "";
int charactersOnCurrentLine = 0;
for (int wordIndex = 0; wordIndex < splitText.Length; wordIndex++)
{
string word = splitText[wordIndex];
if (word.Length + charactersOnCurrentLine + 1 <= lineLimit)
{
if (charactersOnCurrentLine != 0)
text += " ";
text += word;
charactersOnCurrentLine += word.Length + 1;
}
else
{
text += "\r\n" + word;
charactersOnCurrentLine = word.Length;
}
}
return text;
}
FileDialog.OnFileOK(object sender, EventArgs e) changes:
protected virtual void OnFileOK(object sender, EventArgs e)
{
if (m_selectedPidls != null && m_selectedPidls.Length > 0)
{
IntPtr[] pidls = new IntPtr[] { m_selectedPidls[0] };
NativeMethods.SHGFAO attribs = NativeMethods.SHGFAO.SFGAO_STREAM;
m_currentFolder.GetAttributesOf(1, pidls, ref attribs);
if ((attribs & NativeMethods.SHGFAO.SFGAO_STREAM) == 0 && !this.FolderSelect)
{
((NativeMethods.IShellBrowser)this).BrowseObject(m_selectedPidls[0], NativeMethods.SBSP_RELATIVE);
}
else
{
int index = 0;
string[] fileNames = new string[m_selectedPidls.Length];
fileNames[0] =
GetDisplayName(m_currentFolder, m_selectedPidls[0], NativeMethods.SHGNO.SHGDN_FORPARSING);
for (int i = 1; i < m_selectedPidls.Length; i++)
{
pidls = new IntPtr[] { m_selectedPidls[i] };
attribs = NativeMethods.SHGFAO.SFGAO_STREAM;
m_currentFolder.GetAttributesOf(1, pidls, ref attribs);
if ((attribs & NativeMethods.SHGFAO.SFGAO_STREAM) == NativeMethods.SHGFAO.SFGAO_STREAM || this.FolderSelect)
{
fileNames[++index] =
GetDisplayName(m_currentFolder, m_selectedPidls[i], NativeMethods.SHGNO.SHGDN_FORPARSING);
}
}
if (fileNames.Length > index + 1)
Array.Resize(ref fileNames, index + 1);
if (!File.Exists(fileNames[0]) || PromptFileOverwrite(Path.GetFileName(fileNames[0])))
{
m_fileNames = fileNames;
DialogResult = DialogResult.OK;
}
}
}
else
{
string path = fileNameComboBox.Text, driveName;
string trimmedPath = path.Trim();
if (path != trimmedPath)
{
m_ignoreFileNameChange = true;
path = trimmedPath;
fileNameComboBox.Text = trimmedPath;
}
if (string.IsNullOrEmpty(path))
{
if (!string.IsNullOrEmpty(m_currentFilePattern) && m_shellView != null)
{
m_currentFilePattern = string.Empty;
m_shellView.Refresh();
}
return;
}
bool lastCharIsSeparator = (path[path.Length - 1] == Path.DirectorySeparatorChar);
UpdateFileNameMRU(path);
bool isPathRooted = Path.IsPathRooted(path);
string orgPath = path;
if (!isPathRooted)
path =
Path.Combine(
GetDisplayName(m_desktopFolder, m_pidlAbsCurrent, NativeMethods.SHGNO.SHGDN_FORPARSING),
path);
if (path.Contains(".."))
path = Path.GetFullPath(path);
if (Directory.Exists(path))
{
IntPtr pidl;
m_desktopFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, path, IntPtr.Zero, out pidl, 0);
((NativeMethods.IShellBrowser)this).BrowseObject(pidl, NativeMethods.SBSP_ABSOLUTE);
fileNameComboBox.Text = string.Empty;
return;
}
else if (path.Length <= 3 && PathUtils.PathRootIsDrive(path, out driveName))
{
DriveInfo di = new DriveInfo(driveName);
if (di.DriveType == DriveType.CDRom)
{
string message = "The selected disk drive is not in use. Check to make sure a disk is inserted.";
while (!di.IsReady)
{
if (
MessageBoxWithFocusRestore(message, MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) ==
DialogResult.Cancel)
{
fileNameComboBox.SelectAll();
return;
}
}
}
else if (di.DriveType == DriveType.NoRootDirectory)
{
string message =
string.Format("The drive '{0}' is not valid. Enter a valid drive letter.",
driveName.Substring(0, 2));
MessageBoxWithFocusRestore(message, MessageBoxButtons.OK, MessageBoxIcon.Information);
fileNameComboBox.SelectAll();
return;
}
IntPtr pidl;
m_desktopFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, driveName, IntPtr.Zero, out pidl, 0);
((NativeMethods.IShellBrowser)this).BrowseObject(pidl, NativeMethods.SBSP_ABSOLUTE);
fileNameComboBox.Text = string.Empty;
return;
}
else if (lastCharIsSeparator)
{
string message =
string.Format(
@"The folder '{0}' isn't accessible. The folder may be located in an unavailable location, protected with a password, or the filename contains a / or \.",
path);
MessageBoxWithFocusRestore(message, MessageBoxButtons.OK, MessageBoxIcon.Information);
fileNameComboBox.SelectAll();
return;
}
string parentPath = Path.GetDirectoryName(path);
if (File.Exists(path))
{
if (PromptFileOverwrite(Path.GetFileName(path)))
{
FileName = path;
DialogResult = DialogResult.OK;
return;
}
}
else if (Directory.Exists(parentPath))
{
string currentPath =
GetDisplayName(m_desktopFolder, m_pidlAbsCurrent, NativeMethods.SHGNO.SHGDN_FORPARSING);
if (!isPathRooted)
{
if (parentPath != currentPath)
{
IntPtr pidl;
m_currentFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, Path.GetDirectoryName(orgPath),
IntPtr.Zero, out pidl, 0);
((NativeMethods.IShellBrowser)this).BrowseObject(pidl, NativeMethods.SBSP_RELATIVE);
fileNameComboBox.Text = Path.GetFileName(orgPath);
}
PromptFileCreate();
}
else
{
if (parentPath != currentPath)
{
IntPtr pidl;
m_desktopFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, parentPath, IntPtr.Zero, out pidl,
0);
((NativeMethods.IShellBrowser)this).BrowseObject(pidl, NativeMethods.SBSP_ABSOLUTE);
fileNameComboBox.Text = Path.GetFileName(path);
}
PromptFileCreate();
}
}
else
{
if (PromptFileCreate())
{
FileName = path;
DialogResult = DialogResult.OK;
return;
}
}
}
}
FileDialog.NativeMethods.IShellBrowser.BrowseObject(IntPtr pidl, uint wFlags) changes:
int NativeMethods.IShellBrowser.BrowseObject(IntPtr pidl, uint wFlags)
{
int hr;
IntPtr folderTmpPtr;
NativeMethods.IShellFolder folderTmp = null;
IntPtr pidlTmp = IntPtr.Zero;
if (NativeMethods.Shell32.ILIsEqual(pidl, m_desktopPidl))
{
pidlTmp = NativeMethods.Shell32.ILClone(m_desktopPidl);
folderTmp = m_desktopFolder;
}
else if ((wFlags & NativeMethods.SBSP_RELATIVE) != 0)
{
if ((hr = m_currentFolder.BindToObject(pidl, IntPtr.Zero, ref NativeMethods.IID_IShellFolder,
out folderTmpPtr)) != NativeMethods.S_OK)
return hr;
pidlTmp = NativeMethods.Shell32.ILCombine(m_pidlAbsCurrent, pidl);
folderTmp = (NativeMethods.IShellFolder)Marshal.GetObjectForIUnknown(folderTmpPtr);
}
else if ((wFlags & NativeMethods.SBSP_PARENT) != 0)
{
pidlTmp = GetParentPidl(m_pidlAbsCurrent);
string pathTmp = GetDisplayName(m_desktopFolder, pidlTmp, NativeMethods.SHGNO.SHGDN_FORPARSING);
if (pathTmp.Equals(m_desktopPath))
folderTmp = m_desktopFolder;
else
{
if ((hr = m_desktopFolder.BindToObject(pidlTmp, IntPtr.Zero, ref NativeMethods.IID_IShellFolder,
out folderTmpPtr)) != NativeMethods.S_OK)
return hr;
folderTmp = (NativeMethods.IShellFolder)Marshal.GetObjectForIUnknown(folderTmpPtr);
}
}
else
{
pidlTmp = NativeMethods.Shell32.ILClone(pidl);
if ((hr = m_desktopFolder.BindToObject(pidlTmp, IntPtr.Zero, ref NativeMethods.IID_IShellFolder,
out folderTmpPtr)) != NativeMethods.S_OK)
return hr;
folderTmp = (NativeMethods.IShellFolder)Marshal.GetObjectForIUnknown(folderTmpPtr);
}
if (folderTmp == null)
{
NativeMethods.Shell32.ILFree(pidlTmp);
return NativeMethods.E_FAIL;
}
string path = GetDisplayName(m_desktopFolder, pidlTmp, NativeMethods.SHGNO.SHGDN_FORPARSING);
if (path == m_myDocsPath && !NativeMethods.Shell32.ILIsEqual(pidlTmp, m_myDocsPidl))
{
NativeMethods.Shell32.ILFree(pidlTmp);
pidlTmp = NativeMethods.Shell32.ILClone(m_myDocsPidl);
}
string driveName;
if (PathUtils.PathRootIsDrive(path, out driveName))
{
DriveInfo di = new DriveInfo(driveName);
if (di.DriveType == DriveType.CDRom)
{
string message = "The selected disk drive is not in use. Check to make sure a disk is inserted.";
while (!di.IsReady)
{
if (MessageBoxWithFocusRestore(message, MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) ==
DialogResult.Cancel)
return NativeMethods.S_OK;
}
}
else if (di.DriveType == DriveType.NoRootDirectory)
{
string message =
string.Format("The drive '{0}' is not valid. Enter a valid drive letter.",
driveName.Substring(0, 2));
MessageBoxWithFocusRestore(message, MessageBoxButtons.OK, MessageBoxIcon.Information);
return NativeMethods.S_OK;
}
}
if (!this.DesktopOnly || NativeMethods.Shell32.ILIsEqual(pidl, m_desktopPidl))
{
m_currentFolder = folderTmp;
NativeMethods.FOLDERSETTINGS fs = new NativeMethods.FOLDERSETTINGS();
NativeMethods.IShellView lastIShellView = m_shellView;
if (lastIShellView != null)
lastIShellView.GetCurrentInfo(ref fs);
else
{
fs = new NativeMethods.FOLDERSETTINGS();
fs.fFlags = (uint)m_flags;
fs.ViewMode = (uint)m_viewMode;
}
IntPtr iShellViewPtr;
hr = folderTmp.CreateViewObject(Handle, ref NativeMethods.IID_IShellView, out iShellViewPtr);
if (hr == NativeMethods.S_OK)
{
m_shellView = (NativeMethods.IShellView)Marshal.GetObjectForIUnknown(iShellViewPtr);
m_hWndListView = IntPtr.Zero;
NativeMethods.RECT rc =
new NativeMethods.RECT(FileViewPadding.Left, FileViewPadding.Top,
ClientSize.Width - FileViewPadding.Right,
ClientSize.Height - FileViewPadding.Bottom);
int res;
try
{
res = m_shellView.CreateViewWindow(lastIShellView, ref fs, this, ref rc, ref m_hWndListView);
}
catch (COMException)
{
return NativeMethods.E_FAIL;
}
if (res < 0)
return NativeMethods.E_FAIL;
bool shellViewHasFocus = m_shellViewHasFocus;
if (lastIShellView != null)
{
lastIShellView.GetCurrentInfo(ref fs);
lastIShellView.UIActivate((uint)NativeMethods.SVUIA_STATUS.SVUIA_DEACTIVATE);
lastIShellView.DestroyViewWindow();
Marshal.ReleaseComObject(lastIShellView);
}
m_shellView.UIActivate(shellViewHasFocus
? (uint)NativeMethods.SVUIA_STATUS.SVUIA_ACTIVATE_FOCUS
: (uint)NativeMethods.SVUIA_STATUS.SVUIA_ACTIVATE_NOFOCUS);
IntPtr previousPidl = m_pidlAbsCurrent;
m_pidlAbsCurrent = pidlTmp;
UpdateUI(previousPidl);
m_selectedPidls = null;
OnSelectionChanged();
}
}
return NativeMethods.S_OK;
}
FileDialog.OnSelectionChanged() changes:
protected virtual void OnSelectionChanged()
{
if (m_selectedPidls == null)
fileNameComboBox.Text = "";
else
{
if (this.FolderSelect)
{
for (int pidlIndex = 0; pidlIndex < this.m_selectedPidls.Length; pidlIndex++)
{
m_ignoreFileNameChange = true;
if (pidlIndex == 0 && m_selectedPidls.Length == 1)
fileNameComboBox.Text = GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]);
else if (pidlIndex == 0)
fileNameComboBox.Text = "\"" + GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]) + "\"";
else
fileNameComboBox.Text += " \"" + GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]) + "\"";
}
}
else
{
bool firstListed = false;
bool secondListed = false;
for (int pidlIndex = 0; pidlIndex < this.m_selectedPidls.Length; pidlIndex++)
{
IntPtr[] pidls = new IntPtr[] { m_selectedPidls[pidlIndex] };
NativeMethods.SHGFAO attribs = NativeMethods.SHGFAO.SFGAO_FILESYSANCESTOR |
NativeMethods.SHGFAO.SFGAO_STREAM |
NativeMethods.SHGFAO.SFGAO_NEWCONTENT;
m_currentFolder.GetAttributesOf(1, pidls, ref attribs);
bool isFile = ((attribs & NativeMethods.SHGFAO.SFGAO_STREAM) == NativeMethods.SHGFAO.SFGAO_STREAM);
if (isFile)
m_ignoreFileNameChange = true;
if (m_selectedPidls.Length == 1 && isFile)
{
fileNameComboBox.Text = GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]);
firstListed = true;
}
else if (!firstListed && isFile)
{
fileNameComboBox.Text = "\"" + GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]) + "\"";
firstListed = true;
}
else if (isFile)
{
fileNameComboBox.Text += " \"" + GetDisplayName(m_currentFolder, m_selectedPidls[pidlIndex]) + "\"";
secondListed = true;
}
}
if (!firstListed)
{
m_ignoreFileNameChange = true;
fileNameComboBox.Text = "";
}
else if (!secondListed && m_selectedPidls.Length > 1)
{
m_ignoreFileNameChange = true;
fileNameComboBox.Text = fileNameComboBox.Text.Replace("\"", "");
}
}
}
}
FileDialog.NativeMethods.ICommDlgBrowser.IncludeObject(IntPtr ppshv, IntPtr pidl) changes:
int NativeMethods.ICommDlgBrowser.IncludeObject(IntPtr ppshv, IntPtr pidl)
{
IntPtr strr = Marshal.AllocCoTaskMem(NativeMethods.MAX_PATH * 2 + 4);
Marshal.WriteInt32(strr, 0, 0);
StringBuilder buf = new StringBuilder(NativeMethods.MAX_PATH);
IntPtr[] pidls = new IntPtr[] { pidl };
NativeMethods.SHGFAO attribs = NativeMethods.SHGFAO.SFGAO_FILESYSANCESTOR |
NativeMethods.SHGFAO.SFGAO_STREAM |
NativeMethods.SHGFAO.SFGAO_NEWCONTENT;
m_currentFolder.GetAttributesOf(1, pidls, ref attribs);
bool isFile = ((attribs & NativeMethods.SHGFAO.SFGAO_STREAM) == NativeMethods.SHGFAO.SFGAO_STREAM);
if (!isFile && this.HideSpecialFolders)
{
if (NativeMethods.Shell32.ILIsEqual(pidl, this.m_myDocsPidl)
|| NativeMethods.Shell32.ILIsEqual(pidl, this.m_myCompPidl)
|| NativeMethods.Shell32.ILIsEqual(pidl, this.m_myNetPidl))
return NativeMethods.S_FALSE;
}
if (m_excludeFiles && (isFile || (attribs & NativeMethods.SHGFAO.SFGAO_FILESYSANCESTOR) == 0))
return NativeMethods.S_FALSE;
else if (!isFile && (attribs & NativeMethods.SHGFAO.SFGAO_FILESYSANCESTOR) == 0)
return NativeMethods.S_FALSE;
if (m_currentFolder.GetDisplayNameOf(
pidl,
NativeMethods.SHGNO.SHGDN_FORPARSING,
strr) == NativeMethods.S_OK)
{
NativeMethods.Shlwapi.StrRetToBuf(strr, pidl, buf, NativeMethods.MAX_PATH);
string path = buf.ToString();
string name = path.Substring(path.LastIndexOf('\\') + 1);
if (CreateNewFolder(path, pidl))
return NativeMethods.S_OK;
if (m_excludeFiles)
return NativeMethods.S_OK;
FileType fileType = (FileType)fileTypeComboBox.SelectedItem;
if (m_currentFilePattern != string.Empty)
{
if (isFile && !Regex.IsMatch(name, m_currentFilePattern, RegexOptions.Compiled))
return NativeMethods.S_FALSE;
}
else if (fileType != null)
{
if (fileType.IncludeAllFiles)
return NativeMethods.S_OK;
if (isFile && !Regex.IsMatch(name, fileType.FilterPattern, RegexOptions.Compiled))
return NativeMethods.S_FALSE;
}
}
return NativeMethods.S_OK;
}
New FileDialog properties:
[Description("Indicates whether the dialog box does not allow navigation away from the desktop.")]
[Category("Behavior")]
[DefaultValue(false)]
public bool DesktopOnly
{
get { return this.m_DesktopOnly; }
set
{
this.m_DesktopOnly = value;
if (value)
{
this.lookInComboBox.Enabled = false;
this.lookInLabel.Enabled = false;
this.placesBar.Visible = false;
this.fileNameLabel.Location = new Point(5, this.fileNameLabel.Location.Y);
this.fileTypeLabel.Location = new Point(5, this.fileTypeLabel.Location.Y);
this.fileTypeComboBox.Location = new Point(81, this.fileTypeComboBox.Location.Y);
this.fileNameComboBox.Location = new Point(81, this.fileNameComboBox.Location.Y);
this.fileNameComboBox.Width += 90;
this.fileTypeComboBox.Width += 90;
FileViewPadding = new Padding(5, 28, 5, 53);
}
else
{
this.lookInComboBox.Enabled = true;
this.lookInLabel.Enabled = true;
this.placesBar.Visible = true;
this.fileNameLabel.Location = new Point(95, this.fileNameLabel.Location.Y);
this.fileTypeLabel.Location = new Point(95, this.fileTypeLabel.Location.Y);
this.fileTypeComboBox.Location = new Point(171, this.fileTypeComboBox.Location.Y);
this.fileNameComboBox.Location = new Point(171, this.fileNameComboBox.Location.Y);
this.fileNameComboBox.Width -= 90;
this.fileTypeComboBox.Width -= 90;
FileViewPadding = new Padding(96, 28, 5, 53);
}
}
}
[Description("Indicates whether the dialog box allows folders to be selected.")]
[Category("Behavior")]
[DefaultValue(false)]
public bool FolderSelect
{
get { return m_FolderSelect; }
set { m_FolderSelect = value; }
}
[Description("Indicates whether the dialog box hides special folders.")]
[Category("Behavior")]
[DefaultValue(false)]
public bool HideSpecialFolders
{
get { return m_HideSpecialFolders; }
set { m_HideSpecialFolders = value; }
}
[Description("The string to display on the title bar of the dialog box.")]
[Category("Appearance")]
public string Title
{
get { return this.Text; }
set { this.Text = value; }
}
|